avoids function call with an invalid drawable id

2007-08-15  Joao S. O. Bueno Calligaris <gwidion@mpc.com.br>

        * plug-ins/pygimp/pygimp-drawable.c: avoids function call
          with an invalid drawable id


svn path=/trunk/; revision=23272
This commit is contained in:
Joao S. O. Bueno Calligaris 2007-08-15 14:01:01 +00:00 committed by João Sebastião de Oliveira Bueno Calligaris
parent 4a6b4bc067
commit ea9a919220
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2007-08-15 Joao S. O. Bueno Calligaris <gwidion@mpc.com.br>
* plug-ins/pygimp/pygimp-drawable.c: avoids function call
with an invalid drawable id
2007-08-15 Sven Neumann <sven@gimp.org>
* plug-ins/print/print-page-layout.c: applied patch from Stefan

View File

@ -1211,7 +1211,12 @@ pygimp_drawable_new(GimpDrawable *drawable, gint32 ID)
ID = drawable->drawable_id;
/* create the appropriate object type */
if (gimp_drawable_is_layer(ID))
/* avoids calling gimp_drawable_is_layer with an invalid id
* pygimp_channel_new handles it cleanly
*/
if (gimp_drawable_is_valid(ID) &&
gimp_drawable_is_layer(ID))
self = pygimp_layer_new(ID);
else
self = pygimp_channel_new(ID);