[gimp/gimp-2-6] file-cel: use statically allocated palette buffer (cherry picked from commit 69b98191cf315bcf0f7b887



commit f6a5d68d4f5365dcc879f59060a3141d70cce355
Author: Nils Philippsen <nils redhat com>
Date:   Fri Jul 13 15:30:44 2012 +0200

    file-cel: use statically allocated palette buffer
    (cherry picked from commit 69b98191cf315bcf0f7b8878896c01600e67c124)

 plug-ins/common/file-cel.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/plug-ins/common/file-cel.c b/plug-ins/common/file-cel.c
index 95fbe6c..8e82ff7 100644
--- a/plug-ins/common/file-cel.c
+++ b/plug-ins/common/file-cel.c
@@ -556,7 +556,7 @@ load_image (const gchar  *file,
   if (bpp != 32)
     {
       /* 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 */
       if (palette_file == NULL)
@@ -593,10 +593,6 @@ load_image (const gchar  *file,
         }
 
       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 */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]