Fix SDL_BlitSurfaceScaled crash
SDL_BlitSurfaceScaled could crash when passed large coordinates, due
to final_dst.w or final_dst.h getting negative values.
(cherry picked from commit 1c5c3b1479)
This commit is contained in:
1 parent
c1f67585e6
commit
b1cadf0e99
2 files changed
+45
-1
No files matched your search
@@ -1247,7 +1247,7 @@ bool SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surfac
|
||||
// Clip again
|
||||
SDL_GetRectIntersection(clip_rect, &final_dst, &final_dst);
|
||||
|
||||
if (final_dst.w == 0 || final_dst.h == 0 ||
|
||||
if (final_dst.w <= 0 || final_dst.h <= 0 ||
|
||||
final_src.w < 0 || final_src.h < 0) {
|
||||
// No-op.
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user