glx: add missing null check in dri2_bind_tex_image
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Wed, 18 Dec 2013 13:58:00 +0000 (06:58 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 18 Dec 2013 16:40:19 +0000 (09:40 -0700)
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/glx/dri2_glx.c

index 309c1e7d733b41ebadece0d1d42e3fddbc4f1588..ae807eede04cc3f80dbafc9066cc2b0e7de76f24 100644 (file)
@@ -991,10 +991,14 @@ dri2_bind_tex_image(Display * dpy,
    __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;