fix segfault in Fake_glXCreatePBuffer(), bug 4235
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 25 Aug 2005 14:07:06 +0000 (14:07 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 25 Aug 2005 14:07:06 +0000 (14:07 +0000)
src/mesa/drivers/x11/fakeglx.c

index 2cce27d21cc60c5d019bbe9f81605d3acb44fb50..d3213e70898ed854b64408fdf6f0c05010b4c640 100644 (file)
@@ -2099,7 +2099,10 @@ Fake_glXCreatePbuffer( Display *dpy, GLXFBConfig config,
    /* A GLXPbuffer handle must be an X Drawable because that's what
     * glXMakeCurrent takes.
     */
-   return (GLXPbuffer) xmbuf->frontxrb->pixmap;
+   if (xmbuf)
+      return (GLXPbuffer) xmbuf->frontxrb->pixmap;
+   else
+      return 0;
 }