From 80cf8a8b763eba400abac4de934063267d93301f Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Tue, 29 Dec 2020 17:29:31 +0100 Subject: [PATCH] SDL_BlitScaled: also prevent crash if dest width or height is negative --- src/video/SDL_stretch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c index 36dd84930..c69ff87d2 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; }