[Mesa-dev] [PATCH] llvmpipe: use pipe_sampler_view_release() to avoid segfault
Brian Paul
brianp at vmware.com
Sun Dec 22 06:15:12 PST 2013
On 12/22/2013 03:28 AM, Jonathan Liu wrote:
> On 17/12/2013 1:59 AM, Brian Paul wrote:
>> On 12/15/2013 06:24 PM, Jonathan Liu wrote:
>>> This fixes another case of faulting when freeing a pipe_sampler_view
>>> that belongs to a previously destroyed context.
>>>
>>> Signed-off-by: Jonathan Liu <net147 at gmail.com>
>>> ---
>>> src/gallium/drivers/llvmpipe/lp_state_sampler.c | 6 ++++++
>>> 1 file changed, 6 insertions(+)
>>>
>>> diff --git a/src/gallium/drivers/llvmpipe/lp_state_sampler.c
>>> b/src/gallium/drivers/llvmpipe/lp_state_sampler.c
>>> index 1d3db0f..ff498f7 100644
>>> --- a/src/gallium/drivers/llvmpipe/lp_state_sampler.c
>>> +++ b/src/gallium/drivers/llvmpipe/lp_state_sampler.c
>>> @@ -136,6 +136,12 @@ llvmpipe_set_sampler_views(struct pipe_context
>>> *pipe,
>>>
>>> /* set the new sampler views */
>>> for (i = 0; i < num; i++) {
>>> + /* Note: we're using pipe_sampler_view_release() here to work
>>> around
>>> + * a possible crash when the old view belongs to another
>>> context that
>>> + * was already destroyed.
>>> + */
>>> + pipe_sampler_view_release(pipe,
>>> + &llvmpipe->sampler_views[shader][start + i]);
>>> pipe_sampler_view_reference(&llvmpipe->sampler_views[shader][start + i],
>>> views[i]);
>>> }
>>>
>>
>>
>> Reviewed-by: Brian Paul <brianp at vmware.com>
>>
>
> Are you able to commit the patch? I don't have commit access.
Sure, I'll commit both and tag them for the 10.0 branch.
-Brian
More information about the mesa-dev
mailing list