summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobled <nobled@dreamwidth.org>2011-05-06 09:39:24 +0200
committerMichel Dänzer <daenzer@vmware.com>2011-05-06 09:39:24 +0200
commita3e2c8f31f0c5d8d5c1c76e33a572c7be8938573 (patch)
tree5163a7ab3df2a033e271f2750689ce530e4421a2
parent31d27259b6d682f69866ace89ffaac5294e8bf62 (diff)
glx: Check flush DRI extension version at runtime
The DRI driver itself might not have version 3 of the DRI2 flush extension, in which case this would've pointed to out of bounds memory...
-rw-r--r--src/glx/dri2_glx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index fc0237a4f6b..b9f6f7fcf03 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -679,7 +679,7 @@ dri2InvalidateBuffers(Display *dpy, XID drawable)
struct dri2_drawable *pdp = (struct dri2_drawable *) pdraw;
#if __DRI2_FLUSH_VERSION >= 3
- if (pdraw && psc->f)
+ if (pdraw && psc->f && psc->f->base.version >= 3 && psc->f->invalidate)
psc->f->invalidate(pdp->driDrawable);
#endif
}
@@ -702,7 +702,8 @@ dri2_bind_tex_image(Display * dpy,
psc = (struct dri2_screen *) base->psc;
#if __DRI2_FLUSH_VERSION >= 3
- if (!pdp->invalidateAvailable && psc->f)
+ if (!pdp->invalidateAvailable && psc->f &&
+ psc->f->base.version >= 3 && psc->f->invalidate)
psc->f->invalidate(pdraw->driDrawable);
#endif