Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
__GLXDRIdrawable *base = GetGLXDRIDrawable(dpy, drawable);
struct glx_display *dpyPriv = __glXInitialize(dpy);
struct dri2_drawable *pdraw = (struct dri2_drawable *) base;
- struct dri2_display *pdp =
- (struct dri2_display *) dpyPriv->dri2Display;
+ struct dri2_display *pdp;
struct dri2_screen *psc;
+ if (dpyPriv == NULL)
+ return;
+
+ pdp = (struct dri2_display *) dpyPriv->dri2Display;
+
if (pdraw != NULL) {
psc = (struct dri2_screen *) base->psc;