Add checks for maximun scaling size (see bug #5510)

This commit is contained in:
Sylvain Becker
2021-01-29 12:04:48 +01:00
parent 7f710e93f0
commit ebb814310a
2 changed files with 10 additions and 0 deletions

View File

@@ -94,6 +94,11 @@ 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");
}
/* Lock the destination if it's in hardware */
dst_locked = 0;
if (SDL_MUSTLOCK(dst)) {