# HG changeset patch # User David Ludwig # Date 1424655248 18000 # Sun Feb 22 20:34:08 2015 -0500 # Node ID b577c475342146ed77e581da9b3d25cefcac3582 # Parent 679eb3986e372503f30a3012bb0638933c92e354 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! diff -r 679eb3986e37 -r b577c4753421 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 */