Fix size of palette hash table (should be 0x1000, not 0xFFF), don't free palette until AFTER done...

This commit is contained in:
Michael Jumper 2012-04-02 13:27:28 -07:00
parent 71de5606bf
commit ecec3a1099
2 changed files with 4 additions and 3 deletions

View File

@ -51,7 +51,7 @@ typedef struct guac_palette_entry {
typedef struct guac_palette { typedef struct guac_palette {
guac_palette_entry entries[0xFFF]; guac_palette_entry entries[0x1000];
png_color colors[256]; png_color colors[256];
int size; int size;

View File

@ -308,8 +308,6 @@ int __guac_socket_write_length_png(guac_socket* socket, cairo_surface_t* surface
} }
guac_palette_free(palette);
/* Write image info */ /* Write image info */
png_set_IHDR( png_set_IHDR(
png, png,
@ -333,6 +331,9 @@ int __guac_socket_write_length_png(guac_socket* socket, cairo_surface_t* surface
/* Finish write */ /* Finish write */
png_destroy_write_struct(&png, &png_info); png_destroy_write_struct(&png, &png_info);
/* Free palette */
guac_palette_free(palette);
/* Free PNG data */ /* Free PNG data */
for (y=0; y<height; y++) for (y=0; y<height; y++)
free(png_rows[y]); free(png_rows[y]);