Hi Sam SDL-1.2
authorSam Lantinga
Fri, 02 Dec 2011 18:35:04 -0500
branchSDL-1.2
changeset 6099c5d651a8b679
parent 6087 185f8588deaa
child 6109 469e95e71627
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
     1.1 --- a/src/video/x11/SDL_x11yuv.c	Thu Nov 17 03:12:34 2011 -0500
     1.2 +++ b/src/video/x11/SDL_x11yuv.c	Fri Dec 02 18:35:04 2011 -0500
     1.3 @@ -330,8 +330,8 @@
     1.4  #ifdef PITCH_WORKAROUND
     1.5  	if ( hwdata->image != NULL && hwdata->image->pitches[0] != (width*bpp) ) {
     1.6  		/* Ajust overlay width according to pitch */ 
     1.7 +		width = hwdata->image->pitches[0] / bpp;
     1.8  		XFree(hwdata->image);
     1.9 -		width = hwdata->image->pitches[0] / bpp;
    1.10  		hwdata->image = SDL_NAME(XvShmCreateImage)(GFX_Display, xv_port, format,
    1.11  							   0, width, height, yuvshm);
    1.12  	}