Fixed bug 2868 - SDL_FillRect can crash if surface's clip-rect is out-of-bounds
authorDavid Ludwig <dludwig@pobox.com>
Sun, 22 Feb 2015 20:34:08 -0500
changeset 9374 b577c4753421
parent 9373 679eb3986e37
child 9375 bc00287b414f
Fixed bug 2868 - SDL_FillRect can crash if surface's clip-rect is out-of-bounds Thanks to John Skaller for the research into this, and for the fix!
src/video/SDL_fillrect.c
--- a/src/video/SDL_fillrect.c	Sun Feb 22 23:21:32 2015 +0100
+++ b/src/video/SDL_fillrect.c	Sun Feb 22 20:34:08 2015 -0500
@@ -251,6 +251,10 @@
         rect = &clipped;
     } else {
         rect = &dst->clip_rect;
+        /* Don't attempt to fill if the surface's clip_rect is empty */
+        if (SDL_RectEmpty(rect)) {
+            return 0;
+        }
     }
 
     /* Perform software fill */