Commit 9d70711342d7660231108449bfef318354fc26cf

Sylvain Becker 2021-01-30T20:09:35

Revert checks on destination scaling size (see bug #5510)

diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c
index e4424fb..a6480e9 100644
--- a/src/video/SDL_stretch.c
+++ b/src/video/SDL_stretch.c
@@ -94,8 +94,9 @@ SDL_UpperSoftStretch(SDL_Surface * src, const SDL_Rect * srcrect,
         return 0;
     }
 
-    if (srcrect->w > SDL_MAX_UINT16 || srcrect->h > SDL_MAX_UINT16) {
-        return SDL_SetError("Source size too large for scaling");
+    if (srcrect->w > SDL_MAX_UINT16 || srcrect->h > SDL_MAX_UINT16 ||
+        dstrect->w > SDL_MAX_UINT16 || dstrect->h > SDL_MAX_UINT16) {
+        return SDL_SetError("Size too large for scaling");
     }
 
     /* Lock the destination if it's in hardware */
diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c
index bb227f2..bbbe7b5 100644
--- a/src/video/SDL_surface.c
+++ b/src/video/SDL_surface.c
@@ -931,8 +931,9 @@ SDL_PrivateLowerBlitScaled(SDL_Surface * src, SDL_Rect * srcrect,
         SDL_COPY_COLORKEY
     );
 
-    if (srcrect->w > SDL_MAX_UINT16 || srcrect->h > SDL_MAX_UINT16) {
-        return SDL_SetError("Source size too large for scaling");
+    if (srcrect->w > SDL_MAX_UINT16 || srcrect->h > SDL_MAX_UINT16 ||
+        dstrect->w > SDL_MAX_UINT16 || dstrect->h > SDL_MAX_UINT16) {
+        return SDL_SetError("Size too large for scaling");
     }
 
     if (!(src->map->info.flags & SDL_COPY_NEAREST)) {