file-cel: use statically allocated palette buffer

This commit is contained in:
Nils Philippsen 2012-07-13 15:30:44 +02:00
parent b772d1b84c
commit 69b98191cf
1 changed files with 1 additions and 5 deletions

View File

@ -558,7 +558,7 @@ load_image (const gchar *file,
if (bpp != 32) if (bpp != 32)
{ {
/* Use palette from file or otherwise default grey palette */ /* Use palette from file or otherwise default grey palette */
palette = g_new (guchar, colours*3); guchar palette[256*3];
/* Open the file for reading if user picked one */ /* Open the file for reading if user picked one */
if (palette_file == NULL) if (palette_file == NULL)
@ -595,10 +595,6 @@ load_image (const gchar *file,
} }
gimp_image_set_colormap (image, palette + 3, colours - 1); gimp_image_set_colormap (image, palette + 3, colours - 1);
/* Close palette file, give back allocated memory */
g_free (palette);
} }
/* Now get everything redrawn and hand back the finished image */ /* Now get everything redrawn and hand back the finished image */