Skip to content

Commit

Permalink
Hi Sam
Browse files Browse the repository at this point in the history
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
  • Loading branch information
slouken committed Dec 2, 2011
1 parent 5d19ed6 commit b6f1e27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/video/x11/SDL_x11yuv.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit b6f1e27

Please sign in to comment.