mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-24 00:06:10 +00:00
Fixed out of bounds access
This can happen if we try to blit from a surface with an unknown pixel format
This commit is contained in:
@@ -3374,7 +3374,8 @@ SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface *surface)
|
||||
if (dstfmt->Amask) {
|
||||
a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
|
||||
}
|
||||
if (srcfmt->BytesPerPixel <= SDL_arraysize(normal_blit)) {
|
||||
if (srcfmt->BytesPerPixel > 0 &&
|
||||
srcfmt->BytesPerPixel <= SDL_arraysize(normal_blit)) {
|
||||
table = normal_blit[srcfmt->BytesPerPixel - 1];
|
||||
for (which = 0; table[which].dstbpp; ++which) {
|
||||
if (MASKOK(srcfmt->Rmask, table[which].srcR) &&
|
||||
|
||||
Reference in New Issue
Block a user