summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnuj Phogat <anuj.phogat@gmail.com>2012-01-11 15:26:10 -0800
committerIan Romanick <ian.d.romanick@intel.com>2012-01-19 12:56:15 -0800
commit9b3ac17991b3b421591111f863f0583ef2f06a01 (patch)
tree430978d4bb1dc7de7e5d7d4b8e45cb951c2c69d6
parentd7d47d6c0b9120e197305afc28df212c96538e84 (diff)
intel: Fix segfault in glXSwapBuffers with no bound context
Calling glXSwapBuffers with no bound context causes segmentation fault in function intelDRI2Flush. All the gl calls should be ignored after setting the current context to null. So the contents of framebuffer stay unchanged. But the driver should not seg fault. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44614 Reported-by: Yi Sun <yi.sun@intel.com> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Tested-by: Yi Sun <yi.sun@intel.com> (cherry picked from commit dd7220652e65a8a23e7739eeee687f3d6a865b80) Conflicts: src/mesa/drivers/dri/intel/intel_screen.c
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 5ca9b669fec..96d448c38ec 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -108,13 +108,15 @@ intelDRI2Flush(__DRIdrawable *drawable)
GET_CURRENT_CONTEXT(ctx);
struct intel_context *intel = intel_context(ctx);
- if (intel->gen < 4)
- INTEL_FIREVERTICES(intel);
+ if (intel != NULL) {
+ if (intel->gen < 4)
+ INTEL_FIREVERTICES(intel);
- intel->need_throttle = GL_TRUE;
+ intel->need_throttle = GL_TRUE;
- if (intel->batch.used)
- intel_batchbuffer_flush(intel);
+ if (intel->batch.used)
+ intel_batchbuffer_flush(intel);
+ }
}
static const struct __DRI2flushExtensionRec intelFlushExtension = {