Package: libsdl1.2 / 1.2.15+dfsg2-8

SDL_x11yuv.c-fix-possible-use-after-free.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From: Ozkan Sezer <sezeroz@gmail.com>
Date: Sat, 18 Jun 2022 14:55:00 +0300
Subject: SDL_x11yuv.c: fix possible use-after-free

Bug: https://github.com/libsdl-org/SDL-1.2/issues/863
Bug-CVE: CVE-2022-34568
Bug-Debian: https://bugs.debian.org/1016352
Origin: upstream, commit:https://github.com/libsdl-org/SDL-1.2/commit/d7e00208738a0bc6af302723fe64908ac35b777b
---
 src/video/x11/SDL_x11yuv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/video/x11/SDL_x11yuv.c b/src/video/x11/SDL_x11yuv.c
index 62698df..0d5754e 100644
--- a/src/video/x11/SDL_x11yuv.c
+++ b/src/video/x11/SDL_x11yuv.c
@@ -374,8 +374,8 @@ SDL_Overlay *X11_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, S
 #ifdef PITCH_WORKAROUND
 		if ( hwdata->image != NULL && hwdata->image->pitches[0] != (width*bpp) ) {
 			/* Ajust overlay width according to pitch */ 
-			XFree(hwdata->image);
 			width = hwdata->image->pitches[0] / bpp;
+			XFree(hwdata->image);
 			hwdata->image = SDL_NAME(XvCreateImage)(GFX_Display, xv_port, format,
 								0, width, height);
 		}