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



commit 89f4c4042f69c2647f854c5824cb583dfadb6834
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 1b1c424..0f2a4c7 100644
--- a/plug-ins/common/file-cel.c
+++ b/plug-ins/common/file-cel.c
@@ -558,7 +558,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)
@@ -595,10 +595,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]