File bnc#775433-03-file-cel-use-statically-allocated-palette-buffer.patch of Package gimp
From 720eb49d14987c84bd792f9e185ec95160c2e309 Mon Sep 17 00:00:00 2001
From: Nils Philippsen <nils@redhat.com>
Date: Fri, 13 Jul 2012 15:30:44 +0200
Subject: [PATCH 3/5] file-cel: use statically allocated palette buffer
(cherry picked from commit
dbf2538d68f2d3194fb12c14fc713ec7836cd59a)
---
plug-ins/common/file-cel.c | 6 +-----
1 file changed, 1 insertion(+), 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 */
--
1.7.10.4