forked from pool/SDL2_image
Jan Engelhardt
5f507c54b6
a crafted bmp file (boo#1141844 CVE-2019-13616). OBS-URL: https://build.opensuse.org/package/show/games/SDL2_image?expand=0&rev=28
16 lines
513 B
Diff
16 lines
513 B
Diff
diff -r f1baffa48926 -r ba45f00879ba IMG_bmp.c
|
|
--- a/IMG_bmp.c Tue Jul 30 10:16:02 2019 -0700
|
|
+++ b/IMG_bmp.c Tue Jul 30 11:00:12 2019 -0700
|
|
@@ -351,6 +351,11 @@
|
|
SDL_RWseek(src, (biSize - headerSize), RW_SEEK_CUR);
|
|
}
|
|
}
|
|
+ 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;
|