[Mesa-dev] 9.1 candidate? - Re: [PATCH] i965: Avoid segfault in gen6_upload_state

Jordan Justen jljusten at gmail.com
Wed Apr 10 15:58:01 PDT 2013


I think f5a80846 is a candidate for 9.1. This fixes a crash of the
latest build of Anomaly Warzone Earth on the 9.1 branch.

On Tue, Feb 19, 2013 at 4:27 PM, Carl Worth <cworth at cworth.org> wrote:
> This fixes a bug introduced in commit 258453716f001eab1288d99765213 and
> triggered whenever "rb" is NULL.
>
> Fixes bug #59445:
>
>         [SNB/IVB/HSW Bisected]Oglc draw-buffers2(advanced.blending.none) segfault
>         https://bugs.freedesktop.org/show_bug.cgi?id=59445
> ---
>
> I don't know under what conditions "rb" might be NULL, but it's clear that
> it's possible and expected as there is earlier code in this function that
> checks it, (and sets rb_type specifically in that case). So if someone could
> help me write a more descriptive commit message, that would be great.
>
> Also, I notice that similar code in brw_cc.c uses a different condition here:
>
>        if (ctx->DrawBuffer->Visual.alphaBits == 0) {
>
> So an alternate fix could be to switch to something like that. Please let me
> know if one version or the other is cleaner, (and both could be made to
> match).
>
>  src/mesa/drivers/dri/i965/gen6_cc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c b/src/mesa/drivers/dri/i965/gen6_cc.c
> index d32f636..7ac5d5f 100644
> --- a/src/mesa/drivers/dri/i965/gen6_cc.c
> +++ b/src/mesa/drivers/dri/i965/gen6_cc.c
> @@ -126,7 +126,7 @@ gen6_upload_blend_state(struct brw_context *brw)
>            * not read the alpha channel, but will instead use the correct
>            * implicit value for alpha.
>            */
> -         if (!_mesa_base_format_has_channel(rb->_BaseFormat, GL_TEXTURE_ALPHA_TYPE))
> +         if (rb && !_mesa_base_format_has_channel(rb->_BaseFormat, GL_TEXTURE_ALPHA_TYPE))
>           {
>              srcRGB = brw_fix_xRGB_alpha(srcRGB);
>              srcA = brw_fix_xRGB_alpha(srcA);
> --
> 1.7.10.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list