mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +01:00
Fixed bug 4538 - validate image size when loading BMP files
This commit is contained in:
parent
738dff4bbc
commit
97fefd0509
@ -226,6 +226,11 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
|
|||||||
SDL_RWseek(src, (biSize - headerSize), RW_SEEK_CUR);
|
SDL_RWseek(src, (biSize - headerSize), RW_SEEK_CUR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (biWidth <= 0 || biHeight == 0) {
|
||||||
|
SDL_SetError("BMP file with bad dimensions (%dx%d)", biWidth, biHeight);
|
||||||
|
was_error = SDL_TRUE;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
if (biHeight < 0) {
|
if (biHeight < 0) {
|
||||||
topDown = SDL_TRUE;
|
topDown = SDL_TRUE;
|
||||||
biHeight = -biHeight;
|
biHeight = -biHeight;
|
||||||
|
Loading…
Reference in New Issue
Block a user