Fix size of palette hash table (should be 0x1000, not 0xFFF), don't free palette until AFTER done...
This commit is contained in:
parent
71de5606bf
commit
ecec3a1099
@ -51,7 +51,7 @@ typedef struct guac_palette_entry {
|
||||
|
||||
typedef struct guac_palette {
|
||||
|
||||
guac_palette_entry entries[0xFFF];
|
||||
guac_palette_entry entries[0x1000];
|
||||
png_color colors[256];
|
||||
int size;
|
||||
|
||||
|
@ -308,8 +308,6 @@ int __guac_socket_write_length_png(guac_socket* socket, cairo_surface_t* surface
|
||||
|
||||
}
|
||||
|
||||
guac_palette_free(palette);
|
||||
|
||||
/* Write image info */
|
||||
png_set_IHDR(
|
||||
png,
|
||||
@ -333,6 +331,9 @@ int __guac_socket_write_length_png(guac_socket* socket, cairo_surface_t* surface
|
||||
/* Finish write */
|
||||
png_destroy_write_struct(&png, &png_info);
|
||||
|
||||
/* Free palette */
|
||||
guac_palette_free(palette);
|
||||
|
||||
/* Free PNG data */
|
||||
for (y=0; y<height; y++)
|
||||
free(png_rows[y]);
|
||||
|
Loading…
Reference in New Issue
Block a user