mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-24 19:55:26 +03:00
16 lines
502 B
Diff
16 lines
502 B
Diff
diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c
|
|
index 758d4bbc4..6cadc8a55 100644
|
|
--- a/src/video/SDL_bmp.c
|
|
+++ b/src/video/SDL_bmp.c
|
|
@@ -143,6 +143,11 @@ SDL_Surface * SDL_LoadBMP_RW (SDL_RWops *src, int freesrc)
|
|
(void) biYPelsPerMeter;
|
|
(void) biClrImportant;
|
|
|
|
+ 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) {
|
|
topDown = SDL_TRUE;
|
|
biHeight = -biHeight;
|