From 810e80fd50270166d99f4f506500f27ba5003159 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 2 Dec 2011 18:35:04 -0500 Subject: [PATCH] Hi Sam In X11_CreateYUVOverlay hwdata->image will be accessed after it has been freed, causing undefined behavior. Exchanging two lines as shown in this patch will fix that problem: Regards, Bodo --- 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 0372c5a..f3c2a30 100644 --- a/src/video/x11/SDL_x11yuv.c +++ b/src/video/x11/SDL_x11yuv.c @@ -330,8 +330,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(XvShmCreateImage)(GFX_Display, xv_port, format, 0, width, height, yuvshm); } -- 2.39.2