From d6a6662fa19e521574a472e9e9e25c3dcabe7fac Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Fri, 29 Jan 2021 20:34:20 +0100 Subject: [PATCH] Remove checks on destination scaling size (see bug #5510) --- src/video/SDL_stretch.c | 5 ++--- src/video/SDL_surface.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c index 8b5512fe2..e4424fbcc 100644 --- a/src/video/SDL_stretch.c +++ b/src/video/SDL_stretch.c @@ -94,9 +94,8 @@ SDL_UpperSoftStretch(SDL_Surface * src, const SDL_Rect * srcrect, return 0; } - if (srcrect->w > SDL_MAX_UINT16 || srcrect->h > SDL_MAX_UINT16 || - dstrect->w > SDL_MAX_UINT16 || dstrect->h > SDL_MAX_UINT16) { - return SDL_SetError("Too large size for scaling"); + if (srcrect->w > SDL_MAX_UINT16 || srcrect->h > SDL_MAX_UINT16) { + return SDL_SetError("Source 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 0ff6f2a1f..bb227f2cd 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -931,9 +931,8 @@ SDL_PrivateLowerBlitScaled(SDL_Surface * src, SDL_Rect * srcrect, SDL_COPY_COLORKEY ); - if (srcrect->w > SDL_MAX_UINT16 || srcrect->h > SDL_MAX_UINT16 || - dstrect->w > SDL_MAX_UINT16 || dstrect->h > SDL_MAX_UINT16) { - return SDL_SetError("Too large size for scaling"); + if (srcrect->w > SDL_MAX_UINT16 || srcrect->h > SDL_MAX_UINT16) { + return SDL_SetError("Source size too large for scaling"); } if (!(src->map->info.flags & SDL_COPY_NEAREST)) {