[gimp/goat-invasion] libgimp: fix NULL colormap for gimp_drawable_get_format()



commit a6d6f3417abb682f612dbf5084e869674e3e75f8
Author: Simon Budig <simon budig de>
Date:   Mon Apr 30 02:24:14 2012 +0200

    libgimp: fix NULL colormap for gimp_drawable_get_format()

 libgimp/gimpdrawable.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/libgimp/gimpdrawable.c b/libgimp/gimpdrawable.c
index 61756c5..21f9a1d 100644
--- a/libgimp/gimpdrawable.c
+++ b/libgimp/gimpdrawable.c
@@ -777,12 +777,13 @@ gimp_drawable_get_format (gint32 drawable_ID)
                 format = palette;
             }
 
-          babl_palette_set_palette (format,
-                                    babl_format ("R'G'B' u8"),
-                                    colormap, n_colors);
-
-          g_free (colormap);
-
+          if (colormap)
+            {
+              babl_palette_set_palette (format,
+                                        babl_format ("R'G'B' u8"),
+                                        colormap, n_colors);
+              g_free (colormap);
+            }
         }
       else
         {



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