ChangeSet ID: 21526 CVSROOT: /opt/cvs-commit Module name: wine Changes by: julliard@winehq.org 2005/11/29 05:05:45
Modified files: dlls/opengl32 : wgl.c
Log message: Raphael Junqueira fenix@club-internet.fr Fixed crash in wglShareList.
Patch: http://cvs.winehq.org/patch.py?id=21526
Old revision New revision Changes Path 1.67 1.68 +10 -9 wine/dlls/opengl32/wgl.c
Index: wine/dlls/opengl32/wgl.c diff -u -p wine/dlls/opengl32/wgl.c:1.67 wine/dlls/opengl32/wgl.c:1.68 --- wine/dlls/opengl32/wgl.c:1.67 29 Nov 2005 11: 5:45 -0000 +++ wine/dlls/opengl32/wgl.c 29 Nov 2005 11: 5:45 -0000 @@ -560,7 +560,7 @@ BOOL WINAPI wglShareLists(HGLRC hglrc1,
TRACE("(%p, %p)\n", org, dest);
- if (dest->ctx != NULL) { + if (NULL != dest && dest->ctx != NULL) { ERR("Could not share display lists, context already created !\n"); return FALSE; } else { @@ -570,15 +570,16 @@ BOOL WINAPI wglShareLists(HGLRC hglrc1, LEAVE_GL(); TRACE(" created a delayed OpenGL context (%p) for Wine context %p\n", org->ctx, org); } - - ENTER_GL(); - /* Create the destination context with display lists shared */ - dest->ctx = glXCreateContext(org->display, dest->vis, org->ctx, True); - LEAVE_GL(); - TRACE(" created a delayed OpenGL context (%p) for Wine context %p sharing lists with OpenGL ctx %p\n", dest->ctx, dest, org->ctx); + if (NULL != dest) { + ENTER_GL(); + /* Create the destination context with display lists shared */ + dest->ctx = glXCreateContext(org->display, dest->vis, org->ctx, True); + LEAVE_GL(); + TRACE(" created a delayed OpenGL context (%p) for Wine context %p sharing lists with OpenGL ctx %p\n", dest->ctx, dest, org->ctx); + return TRUE; + } } - - return TRUE; + return FALSE; }
/***********************************************************************