浏览代码

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...
tags/mesa-7.11-rc1
nobled 14 年前
父节点
当前提交
a3e2c8f31f
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3
    2
      src/glx/dri2_glx.c

+ 3
- 2
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


正在加载...
取消
保存