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>
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 = true;
+ intel->need_throttle = true;
- if (intel->batch.used)
- intel_batchbuffer_flush(intel);
+ if (intel->batch.used)
+ intel_batchbuffer_flush(intel);
+ }
}
static const struct __DRI2flushExtensionRec intelFlushExtension = {