mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 02:58:05 +02:00
cso: Don't restore nr_samplers in cso_restore_fragment_samplers
If info->nr_samplers > ctx->nr_fragment_samplers_saved, the assignment
would prevent cso_single_sampler_done from unbinding the no longer used
samplers from the driver, which could result in use-after-free. This is
probably unlikely to happen in practice though.
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 3d661a12be)
This commit is contained in:
parent
02c3e9033e
commit
0b63515f22
1 changed files with 0 additions and 1 deletions
|
|
@ -1275,7 +1275,6 @@ cso_restore_fragment_samplers(struct cso_context *ctx)
|
|||
{
|
||||
struct sampler_info *info = &ctx->samplers[PIPE_SHADER_FRAGMENT];
|
||||
|
||||
info->nr_samplers = ctx->nr_fragment_samplers_saved;
|
||||
memcpy(info->samplers, ctx->fragment_samplers_saved,
|
||||
sizeof(info->samplers));
|
||||
cso_single_sampler_done(ctx, PIPE_SHADER_FRAGMENT);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue