File: CVE-2019-13616.patch

package info (click to toggle)
libsdl1.2 1.2.15%2Bdfsg2-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 17,276 kB
  • sloc: ansic: 128,536; cpp: 11,192; sh: 9,887; asm: 2,553; objc: 2,128; makefile: 355; csh: 248; perl: 35; pascal: 8
file content (22 lines) | stat: -rw-r--r-- 721 bytes parent folder | download | duplicates (2)
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;