i965: Actually emit PIPELINE_SELECT and 3DSTATE_VF_STATISTICS.
[mesa.git] / src / glx / dri2.c
index bcd1f9c90117d8105fb01dcbc0751d6fa08b2de4..7cb9d2dba9c4fb7c474bc50a6ad19d101f0d266b 100644 (file)
@@ -38,7 +38,6 @@
 #include <X11/extensions/Xext.h>
 #include <X11/extensions/extutil.h>
 #include <X11/extensions/dri2proto.h>
-#include "xf86drm.h"
 #include "dri2.h"
 #include "glxclient.h"
 #include "GL/glxext.h"
@@ -102,6 +101,8 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
       __GLXDRIdrawable *pdraw;
 
       pdraw = dri2GetGlxDrawableFromXDrawableId(dpy, awire->drawable);
+      if (pdraw == NULL)
+         return False;
 
       /* Ignore swap events if we're not looking for them */
       aevent->type = dri2GetSwapEventType(dpy, awire->drawable);