diff --git a/ChangeLog b/ChangeLog index 1e50cdecd1..b7b90c6f79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-11-08 Sven Neumann + + * app/core/gimpdrawable.c (gimp_drawable_mask_bounds) + (gimp_drawable_mask_intersect): initialize the return values before + checking if the drawable is attached. Keeps GIMP from going mad if + this assertion is ever triggered. + 2004-11-07 Sven Neumann * plug-ins/helpbrowser/dialog.c: don't connect the help browser to diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c index 99efe18dd9..6de578e420 100644 --- a/app/core/gimpdrawable.c +++ b/app/core/gimpdrawable.c @@ -1216,7 +1216,12 @@ gimp_drawable_mask_bounds (GimpDrawable *drawable, g_return_val_if_fail (x2 != NULL, FALSE); g_return_val_if_fail (y2 != NULL, FALSE); - item = GIMP_ITEM (drawable); + item = GIMP_ITEM (drawable); + + *x1 = 0; + *y1 = 0; + *x2 = gimp_item_width (item); + *y2 = gimp_item_height (item); g_return_val_if_fail (gimp_item_is_attached (item), FALSE); @@ -1238,11 +1243,6 @@ gimp_drawable_mask_bounds (GimpDrawable *drawable, return TRUE; } - *x1 = 0; - *y1 = 0; - *x2 = gimp_item_width (item); - *y2 = gimp_item_height (item); - return FALSE; } @@ -1265,6 +1265,11 @@ gimp_drawable_mask_intersect (GimpDrawable *drawable, item = GIMP_ITEM (drawable); + *x = 0; + *y = 0; + *width = gimp_item_width (item); + *height = gimp_item_height (item); + g_return_val_if_fail (gimp_item_is_attached (item), FALSE); gimage = gimp_item_get_image (item); @@ -1286,11 +1291,6 @@ gimp_drawable_mask_intersect (GimpDrawable *drawable, width, height); } - *x = 0; - *y = 0; - *width = gimp_item_width (item); - *height = gimp_item_height (item); - return TRUE; }