mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-25 20:25:28 +03:00
16 lines
484 B
Diff
16 lines
484 B
Diff
diff --git a/IMG_bmp.c b/IMG_bmp.c
|
|
index b3c7580..bfadd45 100644
|
|
--- a/IMG_bmp.c
|
|
+++ b/IMG_bmp.c
|
|
@@ -272,6 +272,11 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc)
|
|
biClrUsed = SDL_ReadLE32(src);
|
|
biClrImportant = SDL_ReadLE32(src);
|
|
}
|
|
+ if (biWidth <= 0 || biHeight == 0) {
|
|
+ IMG_SetError("BMP file with bad dimensions (%dx%d)", biWidth, biHeight);
|
|
+ was_error = SDL_TRUE;
|
|
+ goto done;
|
|
+ }
|
|
if (biHeight < 0) {
|
|
topDown = SDL_TRUE;
|
|
biHeight = -biHeight;
|