bug in app/gimpdrawable.c

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

 



The function gimp-drawable-type-with-alpha wasn't
completely guarded. Calling it with a non-existent
drawable would cause a crash.

--- gimp-cvs-2601-2000/app/gimpdrawable.c Mon Jan 31 22:57:32 2000
+++ gimp-patches/app/gimpdrawable.c Mon Jan 31 22:57:54 2000
@@ -277,9 +277,13 @@
 GimpImageType
 gimp_drawable_type_with_alpha (GimpDrawable *drawable)
 {
-  GimpImageType type = gimp_drawable_type (drawable);
+  GimpImageType type;
+  gboolean has_alpha;
 
-  gboolean has_alpha = gimp_drawable_has_alpha (drawable);
+  type = gimp_drawable_type (drawable);
+  if (type == -1)
+    return 0;
+  has_alpha = gimp_drawable_has_alpha (drawable);
 
   if (has_alpha)
     return type;






[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux