diff options
author | Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> | 2013-12-18 06:58:00 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2013-12-18 09:40:19 -0700 |
commit | c02f6c26d32bc7ce6214bc9653b2c083fbed7dc7 (patch) | |
tree | be0d7554e297d05164fffe4f5676840fd15f4851 /src/glx | |
parent | a9bf5999d1a2b5ce59a5101582f838bbf147765d (diff) |
glx: add missing null check in dri2_bind_tex_image
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/glx')
-rw-r--r-- | src/glx/dri2_glx.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 309c1e7d733..ae807eede04 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -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; |