diff options
author | Jonathan Liu <[email protected]> | 2013-12-15 18:24:00 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-12-22 07:07:56 -0700 |
commit | 7990ab58fa01cbebcefd63dd25af5fd6fdddf019 (patch) | |
tree | 5fe4c8b1d350ff7dc16d36a76e323f8dc1516baa /src/gallium/drivers | |
parent | 670be71bd801fea876f7512865ed5f54340da9be (diff) |
llvmpipe: use pipe_sampler_view_release() to avoid segfault
This fixes another case of faulting when freeing a pipe_sampler_view
that belongs to a previously destroyed context.
Cc: "10.0" <[email protected]>
Signed-off-by: Jonathan Liu <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_sampler.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_sampler.c b/src/gallium/drivers/llvmpipe/lp_state_sampler.c index 1d3db0f25c7..ff498f7f15a 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]); } |