# HG changeset patch # User tron # Date 1157233926 0 # Node ID d12168a851342235f51dd90d3ba14a37db1a0845 # Parent ae5cb0a893649a31d5e3590dc6fcd92410ac1634 (svn r6351) -Fix: Due to some off-by-one errors the width or height of a clipping rectangle could become 0, which isn't sensible. This should fix a very rare and hard to trigger assertion in GfxFillRect() diff -r ae5cb0a89364 -r d12168a85134 gfx.c --- a/gfx.c Sat Sep 02 21:16:46 2006 +0000 +++ b/gfx.c Sat Sep 02 21:52:06 2006 +0000 @@ -1862,7 +1862,7 @@ if ((left -= o->left) < 0) { width += left; - if (width < 0) return false; + if (width <= 0) return false; n->left = -left; left = 0; } else { @@ -1871,13 +1871,13 @@ if (width > o->width - left) { width = o->width - left; - if (width < 0) return false; + if (width <= 0) return false; } n->width = width; if ((top -= o->top) < 0) { height += top; - if (height < 0) return false; + if (height <= 0) return false; n->top = -top; top = 0; } else { @@ -1888,7 +1888,7 @@ if (height > o->height - top) { height = o->height - top; - if (height < 0) return false; + if (height <= 0) return false; } n->height = height;