Check if the array index is legal before using it, not the other way

2004-07-18  Philip Lafleur  <plafleur@cvs.gnome.org>

	* app/paint/gimpink-blob.c (blob_make_convex): Check if the
	array index is legal before using it, not the other way around.
	Fixes bug #144856.
This commit is contained in:
Philip Lafleur 2004-07-18 09:10:17 +00:00 committed by Philip Lafleur
parent 68aa11c012
commit a1c89069db
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2004-07-18 Philip Lafleur <plafleur@cvs.gnome.org>
* app/paint/gimpink-blob.c (blob_make_convex): Check if the
array index is legal before using it, not the other way around.
Fixes bug #144856.
2004-07-17 Philip Lafleur <plafleur@cvs.gnome.org>
* plug-ins/common/polar.c (dialog_update_preview): Fixed a

View File

@ -678,7 +678,7 @@ blob_make_convex (Blob *b,
{
present[i2] &= ~EDGE_LEFT;
i2 = i1;
while (! (present[--i1] & EDGE_LEFT) && i1 >= start);
while ((--i1) >= start && (! (present[i1] & EDGE_LEFT)));
if (i1 < start)
{
@ -719,8 +719,7 @@ blob_make_convex (Blob *b,
{
present[i2] &= ~EDGE_RIGHT;
i2 = i1;
while (! (present[--i1] & EDGE_RIGHT) && i1 >= start)
;
while ((--i1) >= start && (! (present[i1] & EDGE_RIGHT)));
if (i1 < start)
{