From dd1a9f75dc1d29e3383f27aaa1cf024c83e5c8e2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Aug 2005 14:07:06 +0000 Subject: [PATCH] fix segfault in Fake_glXCreatePBuffer(), bug 4235 --- src/mesa/drivers/x11/fakeglx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 2cce27d21cc..d3213e70898 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -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; } -- 2.30.2