This fixes some use-after-free situations in dEQP when an xfb state is
removed, and then a clear is triggered, which only does a partial
validation. It would attempt to read the no-longer-valid buffers,
resulting in crashes.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
if (!(nvc0->dirty_3d & NVC0_NEW_3D_TFB_TARGETS))
return;
- nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_TFB);
for (b = 0; b < nvc0->num_tfbbufs; ++b) {
struct nvc0_so_target *targ = nvc0_so_target(nvc0->tfbbuf[b]);
}
nvc0->num_tfbbufs = num_targets;
- if (nvc0->tfbbuf_dirty)
+ if (nvc0->tfbbuf_dirty) {
+ nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_TFB);
nvc0->dirty_3d |= NVC0_NEW_3D_TFB_TARGETS;
+ }
}
static void