initialize the return values before checking if the drawable is attached.

2004-11-08  Sven Neumann  <sven@gimp.org>

	* 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.
This commit is contained in:
Sven Neumann 2004-11-07 23:17:39 +00:00 committed by Sven Neumann
parent bc0688c1fa
commit 66de1a73dc
2 changed files with 18 additions and 11 deletions

View File

@ -1,3 +1,10 @@
2004-11-08 Sven Neumann <sven@gimp.org>
* 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 <sven@gimp.org>
* plug-ins/helpbrowser/dialog.c: don't connect the help browser to

View File

@ -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;
}