Merge lp:~vanvugt/compiz/fix-1054257 into lp:compiz/0.9.8

Proposed by Daniel van Vugt
Status: Merged
Approved by: Daniel van Vugt
Approved revision: 3386
Merged at revision: 3388
Proposed branch: lp:~vanvugt/compiz/fix-1054257
Merge into: lp:compiz/0.9.8
Diff against target: 33 lines (+6/-2)
1 file modified
plugins/opengl/src/screen.cpp (+6/-2)
To merge this branch: bzr merge lp:~vanvugt/compiz/fix-1054257
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
jenkins (community) continuous-integration Approve
Review via email: mp+126155@code.launchpad.net

Commit message

Avoid passing an uninitialized context into glXDestroyContext, which can
cause crashes. (LP: #1054724)

For fglrx users, this seems to happen after:
  glXQueryExtensionsString is NULL for screen %d (LP: #1054257)
But still, we shouldn't crash.

Description of the change

Avoid passing an uninitialized context into glXDestroyContext, which can
cause crashes. (LP: #1054724)

For fglrx users, this seems to happen after:
  glXQueryExtensionsString is NULL for screen %d (LP: #1054257)
But still, we shouldn't crash.

To post a comment you must log in.
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sam Spilsbury (smspillaz) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/opengl/src/screen.cpp'
2--- plugins/opengl/src/screen.cpp 2012-09-25 04:11:26 +0000
3+++ plugins/opengl/src/screen.cpp 2012-09-25 05:26:20 +0000
4@@ -1093,13 +1093,15 @@
5 EGLDisplay dpy = eglGetDisplay (xdpy);
6
7 eglMakeCurrent (dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
8- eglDestroyContext (dpy, priv->ctx);
9+ if (priv->ctx != EGL_NO_CONTEXT)
10+ eglDestroyContext (dpy, priv->ctx);
11 eglDestroySurface (dpy, priv->surface);
12 eglTerminate (dpy);
13 eglReleaseThread ();
14 #else
15
16- glXDestroyContext (screen->dpy (), priv->ctx);
17+ if (priv->ctx)
18+ glXDestroyContext (screen->dpy (), priv->ctx);
19 #endif
20
21 if (priv->scratchFbo)
22@@ -1119,9 +1121,11 @@
23 clearBuffers (true),
24 lighting (false),
25 #ifndef USE_GLES
26+ ctx (NULL),
27 getProcAddress (0),
28 doubleBuffer (screen->dpy (), *screen, cScreen->output ()),
29 #else
30+ ctx (EGL_NO_CONTEXT),
31 doubleBuffer (screen->dpy (), *screen, surface),
32 #endif
33 scratchFbo (NULL),

Subscribers

People subscribed via source and target branches