mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 19:20:12 +01:00
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" <mesa-stable@lists.freedesktop.org> Signed-off-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
670be71bd8
commit
7990ab58fa
1 changed files with 6 additions and 0 deletions
|
|
@ -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]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue