summaryrefslogtreecommitdiff
path: root/src/video/SDL_fillrect.c
diff options
context:
space:
mode:
authorDavid Ludwig <dludwig@pobox.com>2015-02-22 20:34:08 -0500
committerDavid Ludwig <dludwig@pobox.com>2015-02-22 20:34:08 -0500
commit58c45cae9d573b21397eb0016f21a5c6ef4c329b (patch)
tree1535bff9ecb9131e6af7dcb7a38fc34767c3699d /src/video/SDL_fillrect.c
parentb292b87d0df3eea1a2fdb57a5ccaef75f0787af1 (diff)
downloadsdl-58c45cae9d573b21397eb0016f21a5c6ef4c329b.tar.gz
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!
Diffstat (limited to 'src/video/SDL_fillrect.c')
-rw-r--r--src/video/SDL_fillrect.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/video/SDL_fillrect.c b/src/video/SDL_fillrect.c
index 5f343eaf2..84707842e 100644
--- a/src/video/SDL_fillrect.c
+++ b/src/video/SDL_fillrect.c
@@ -251,6 +251,10 @@ SDL_FillRect(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color)
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 */