gallium/rbug: correctly unreference a sampler view
authorMarek Olšák <marek.olsak@amd.com>
Mon, 22 Sep 2014 20:12:43 +0000 (22:12 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 24 Sep 2014 12:48:02 +0000 (14:48 +0200)
This fixes heap corruption. The sampler view can be bound in the context,
so we cannot call destroy directly.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/rbug/rbug_objects.c

index db18f2e1c22a3dae6304ac2d4bb11999e4b6a30d..320f34d2565e9a6a6972bca9ce3634b04a08c910 100644 (file)
@@ -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);
 }