SDL_SoftStretch() doesn't handle large pixel formats

Fixes https://github.com/libsdl-org/SDL/issues/11534
This commit is contained in:
Sam Lantinga
2024-12-21 06:16:10 -08:00
parent f37eef948c
commit cadeec9cc9
2 changed files with 65 additions and 1 deletions

View File

@@ -1254,7 +1254,8 @@ bool SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, S
if (scaleMode == SDL_SCALEMODE_NEAREST) {
if (!(src->map.info.flags & complex_copy_flags) &&
src->format == dst->format &&
!SDL_ISPIXELFORMAT_INDEXED(src->format)) {
!SDL_ISPIXELFORMAT_INDEXED(src->format) &&
SDL_BYTESPERPIXEL(src->format) <= 4) {
return SDL_SoftStretch(src, srcrect, dst, dstrect, SDL_SCALEMODE_NEAREST);
} else if (SDL_BITSPERPIXEL(src->format) < 8) {
// Scaling bitmap not yet supported, convert to RGBA for blit