[Mesa-dev] Mesa (master): intel: Fix segfault in glXSwapBuffers with no bound context
Chad Versace
chad.versace at linux.intel.com
Mon Jan 16 16:44:06 PST 2012
Anuj, when a bugfix like this can be backported to a stable branch, please
annotate the commit message with
Note: This is a candidate for the X.X branch
or
Note: This is a candidate for the stable branches.
This helps the stable branch maintainer automate the backport
process.
Thanks,
Chad Versace
chad.versace at linux.intel.com
On 01/16/2012 03:13 PM, Anuj Phogat wrote:
> Module: Mesa
> Branch: master
> Commit: dd7220652e65a8a23e7739eeee687f3d6a865b80
> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dd7220652e65a8a23e7739eeee687f3d6a865b80
>
> Author: Anuj Phogat <anuj.phogat at gmail.com>
> Date: Wed Jan 11 15:26:10 2012 -0800
>
> 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 at intel.com>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
> Tested-by: Yi Sun <yi.sun at intel.com>
>
> ---
>
> src/mesa/drivers/dri/intel/intel_screen.c | 12 +++++++-----
> 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 b0e800b..a08f3d1 100644
> --- a/src/mesa/drivers/dri/intel/intel_screen.c
> +++ b/src/mesa/drivers/dri/intel/intel_screen.c
> @@ -115,13 +115,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 = 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 = {
More information about the mesa-dev
mailing list