1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
# HG changeset patch
# User Ozkan Sezer <sezeroz@gmail.com>
# Date 1564511424 -10800
# Node ID ad1bbfbca760cbf5bf8131580b24637e5e7d9411
# Parent 87d60cae0273307b2721685daf3265de5dfda634
Fixed bug 4538 - validate image size when loading BMP files
diff -r 87d60cae0273 -r ad1bbfbca760 src/video/SDL_bmp.c
--- a/src/video/SDL_bmp.c Tue Jun 18 23:31:40 2019 +0100
+++ b/src/video/SDL_bmp.c Tue Jul 30 21:30:24 2019 +0300
@@ -143,6 +143,11 @@
(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;
|