mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-03-12 04:01:17 +01:00
We don't currently support blitting to < 8 bpp surfaces, return an error instead of corrupting memory in that case.
This commit is contained in:
parent
2ba66d0525
commit
49225f5f04
@ -219,6 +219,12 @@ SDL_CalculateBlit(SDL_Surface * surface)
|
||||
SDL_BlitMap *map = surface->map;
|
||||
SDL_Surface *dst = map->dst;
|
||||
|
||||
/* We don't currently support blitting to < 8 bpp surfaces */
|
||||
if (dst->format->BitsPerPixel < 8) {
|
||||
SDL_InvalidateMap(map);
|
||||
return SDL_SetError("Blit combination not supported");
|
||||
}
|
||||
|
||||
/* Clean everything out to start */
|
||||
if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) {
|
||||
SDL_UnRLESurface(surface, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user