Skip to content

Commit

Permalink
Fixed bug 2868 - SDL_FillRect can crash if surface's clip-rect is out…
Browse files Browse the repository at this point in the history
…-of-bounds

Thanks to John Skaller for the research into this, and for the fix!
  • Loading branch information
DavidLudwig committed Feb 23, 2015
1 parent 8321efb commit d6c4296
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/video/SDL_fillrect.c
Expand Up @@ -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 */
Expand Down

0 comments on commit d6c4296

Please sign in to comment.