mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-31 00:09:19 +01:00
Add checks for maximun scaling size (see bug #5510)
This commit is contained in:
parent
7f710e93f0
commit
ebb814310a
@ -94,6 +94,11 @@ SDL_UpperSoftStretch(SDL_Surface * src, const SDL_Rect * srcrect,
|
|||||||
return 0;
|
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 */
|
/* Lock the destination if it's in hardware */
|
||||||
dst_locked = 0;
|
dst_locked = 0;
|
||||||
if (SDL_MUSTLOCK(dst)) {
|
if (SDL_MUSTLOCK(dst)) {
|
||||||
|
@ -931,6 +931,11 @@ SDL_PrivateLowerBlitScaled(SDL_Surface * src, SDL_Rect * srcrect,
|
|||||||
SDL_COPY_COLORKEY
|
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 (!(src->map->info.flags & SDL_COPY_NEAREST)) {
|
if (!(src->map->info.flags & SDL_COPY_NEAREST)) {
|
||||||
src->map->info.flags |= SDL_COPY_NEAREST;
|
src->map->info.flags |= SDL_COPY_NEAREST;
|
||||||
SDL_InvalidateMap(src->map);
|
SDL_InvalidateMap(src->map);
|
||||||
|
Loading…
Reference in New Issue
Block a user