[Mesa-dev] [PATCH] i830_state:i830Enable(): Fix crash for GL_STENCIL_TEST

Kenneth Graunke kenneth at whitecape.org
Tue May 29 11:33:45 PDT 2012


On 05/29/2012 08:24 AM, Eric Anholt wrote:
> On Tue, 29 May 2012 08:53:12 -0600, Brian Paul <brian.e.paul at gmail.com> wrote:
>> On Fri, May 25, 2012 at 5:26 PM, Kurt Roeckx <kurt at roeckx.be> wrote:
>>> Can someone please review and commit this?  A lot of the piglit
>>> tests fail because of this.
>>>
>>>
>>> Kurt
>>>
>>> On Fri, May 11, 2012 at 12:19:42AM +0200, Kurt Roeckx wrote:
>>>> commit 87f12bb2d95236c7b025d1a8be56b5ab1683d702 tried to fix rb->mt
>>>> being NULL, but change this case wrong.
>>>>
>>>> Note: this is a candidate for the 8.0 branch
>>>>
>>>> Signed-off-by: Kurt Roeckx <kurt at roeckx.be>
>>>> ---
>>>>  src/mesa/drivers/dri/i915/i830_state.c |    2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c
>>>> index 6f8bd69..647ba62 100644
>>>> --- a/src/mesa/drivers/dri/i915/i830_state.c
>>>> +++ b/src/mesa/drivers/dri/i915/i830_state.c
>>>> @@ -862,7 +862,7 @@ i830Enable(struct gl_context * ctx, GLenum cap, GLboolean state)
>>>>           if (ctx->DrawBuffer) {
>>>>              struct intel_renderbuffer *irbStencil
>>>>                 = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL);
>>>> -            hw_stencil = (irbStencil && irbStencil->mt->region);
>>>> +            hw_stencil = (irbStencil && irbStencil->mt);
>>
>> I would think that you should test all three pointers to be safe:
>>
>> hw_stencil = irbStencil && irbStencil->mt && irbStencil->mt->region;
>>
>> I can commit that change later if there's no objections.
> 
> If there's a mt, there's a region.

That's correct.

I've added my R-b and pushed this.  Thanks!


More information about the mesa-dev mailing list