bail out early (before checking other parameters) if width or height are

zero

svn path=/trunk/; revision=22268
This commit is contained in:
Sven Neumann 2007-04-17 19:09:58 +00:00
parent 5dde91daab
commit 18d85d40b4
1 changed files with 19 additions and 4 deletions

View File

@ -348,6 +348,10 @@ gimp_preview_area_draw (GimpPreviewArea *area,
g_return_if_fail (GIMP_IS_PREVIEW_AREA (area));
g_return_if_fail (width >= 0 && height >= 0);
if (width == 0 || height == 0)
return;
g_return_if_fail (buf != NULL);
g_return_if_fail (rowstride > 0);
@ -606,6 +610,10 @@ gimp_preview_area_blend (GimpPreviewArea *area,
g_return_if_fail (GIMP_IS_PREVIEW_AREA (area));
g_return_if_fail (width >= 0 && height >= 0);
if (width == 0 || height == 0)
return;
g_return_if_fail (buf1 != NULL);
g_return_if_fail (buf2 != NULL);
g_return_if_fail (rowstride1 > 0);
@ -987,6 +995,10 @@ gimp_preview_area_mask (GimpPreviewArea *area,
g_return_if_fail (GIMP_IS_PREVIEW_AREA (area));
g_return_if_fail (width >= 0 && height >= 0);
if (width == 0 || height == 0)
return;
g_return_if_fail (buf1 != NULL);
g_return_if_fail (buf2 != NULL);
g_return_if_fail (mask != NULL);
@ -1499,14 +1511,14 @@ gimp_preview_area_mask (GimpPreviewArea *area,
* @area: a #GimpPreviewArea widget.
* @x: x offset in preview
* @y: y offset in preview
* @width: buffer width
* @height: buffer height
* @width: width of the rectangle to fill
* @height: height of the rectangle to fill
* @red: red component of the fill color (0-255)
* @green: green component of the fill color (0-255)
* @blue: red component of the fill color (0-255)
*
* Fills @area in the given color and queues a redraw on the given
* rectangle.
* Fills the given rectangle of @area in the given color and queues a
* redraw.
*
* Since GIMP 2.2
**/
@ -1528,6 +1540,9 @@ gimp_preview_area_fill (GimpPreviewArea *area,
g_return_if_fail (GIMP_IS_PREVIEW_AREA (area));
g_return_if_fail (width >= 0 && height >= 0);
if (width == 0 || height == 0)
return;
if (x + width < 0 || x >= area->width)
return;