src/video/x11/SDL_x11yuv.c
branchSDL-1.2
changeset 6099 c5d651a8b679
parent 4159 a1b03ba2fcd0
child 6137 4720145f848b
--- a/src/video/x11/SDL_x11yuv.c	Thu Nov 17 03:12:34 2011 -0500
+++ b/src/video/x11/SDL_x11yuv.c	Fri Dec 02 18:35:04 2011 -0500
@@ -330,8 +330,8 @@
 #ifdef PITCH_WORKAROUND
 	if ( hwdata->image != NULL && hwdata->image->pitches[0] != (width*bpp) ) {
 		/* Ajust overlay width according to pitch */ 
+		width = hwdata->image->pitches[0] / bpp;
 		XFree(hwdata->image);
-		width = hwdata->image->pitches[0] / bpp;
 		hwdata->image = SDL_NAME(XvShmCreateImage)(GFX_Display, xv_port, format,
 							   0, width, height, yuvshm);
 	}