Commit 80cf8a8b763eba400abac4de934063267d93301f

Sylvain Becker 2020-12-29T17:29:31

SDL_BlitScaled: also prevent crash if dest width or height is negative

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c
index 36dd849..c69ff87 100644
--- a/src/video/SDL_stretch.c
+++ b/src/video/SDL_stretch.c
@@ -260,7 +260,7 @@ SDL_UpperSoftStretch(SDL_Surface * src, const SDL_Rect * srcrect,
         dstrect = &full_dst;
     }
 
-    if (dstrect->w == 0 || dstrect->h == 0) {
+    if (dstrect->w <= 0 || dstrect->h <= 0) {
         return 0;
     }