mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-02-03 23:01:12 +00:00
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!
This commit is contained in:
parent
8321efba33
commit
d6c4296653
|
@ -251,6 +251,10 @@ SDL_FillRect(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color)
|
||||||
rect = &clipped;
|
rect = &clipped;
|
||||||
} else {
|
} else {
|
||||||
rect = &dst->clip_rect;
|
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 */
|
/* Perform software fill */
|
||||||
|
|
Loading…
Reference in a new issue