summaryrefslogtreecommitdiff
path: root/glx/glxdri2.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-06-21 14:08:50 +1000
committerKeith Packard <keithp@keithp.com>2010-06-22 11:40:15 -0700
commitc6bc52cb6663138d1273447cb7661fa6e958f539 (patch)
tree65d6e33eafa7af6dffa9fc9f17b4d05e25a917a6 /glx/glxdri2.c
parent80d1a548d6ce73c2ff097536c1bc7044bf74965d (diff)
dri2: avoid crash with old dri drivers.
I built latest server and copied over a mesa 7.8 dri2 driver to use with it, and it crashed in here starting compiz. Looks like we need to validate the flush extension is registered before calling invalidate. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Michel Dänzer <michel@daenzer.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'glx/glxdri2.c')
-rw-r--r--glx/glxdri2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 177c73ca2..970a51ae3 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -435,7 +435,8 @@ __glXDRIinvalidateBuffers(DrawablePtr pDraw, void *priv)
__GLXDRIdrawable *private = priv;
__GLXDRIscreen *screen = private->screen;
- (*screen->flush->invalidate)(private->driDrawable);
+ if (screen->flush)
+ (*screen->flush->invalidate)(private->driDrawable);
#endif
}