[Mesa-dev] [PATCH 2/2] gallium/rbug: correctly unreference a sampler view

Brian Paul brian.e.paul at gmail.com
Mon Sep 22 15:22:49 PDT 2014


On Mon, Sep 22, 2014 at 3:18 PM, Marek Olšák <maraeo at gmail.com> wrote:

> From: Marek Olšák <marek.olsak at amd.com>
>
> This fixes heap corruption. The sampler view can be bound in the context,
> so we cannot call destroy directly.
> ---
>  src/gallium/drivers/rbug/rbug_objects.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/rbug/rbug_objects.c
> b/src/gallium/drivers/rbug/rbug_objects.c
> index db18f2e..320f34d 100644
> --- a/src/gallium/drivers/rbug/rbug_objects.c
> +++ b/src/gallium/drivers/rbug/rbug_objects.c
> @@ -153,8 +153,7 @@ rbug_sampler_view_destroy(struct rbug_context
> *rb_context,
>                            struct rbug_sampler_view *rb_view)
>  {
>     pipe_resource_reference(&rb_view->base.texture, NULL);
> -   rb_context->pipe->sampler_view_destroy(rb_context->pipe,
> -                                          rb_view->sampler_view);
> +   pipe_sampler_view_reference(&rb_view->sampler_view, NULL);
>     FREE(rb_view);
>  }
>
>
Reviewed-by: Brian Paul <brianp at vmware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140922/9490014b/attachment.html>


More information about the mesa-dev mailing list