vo_vaapi: fix use-after-free when quitting

p->output_surfaces gets freed by destroy_frame when quitting
This commit is contained in:
llyyr 2024-05-28 19:00:54 +05:30 committed by sfan5
parent ff73aeb5c3
commit 0aec73d1bf
1 changed files with 2 additions and 9 deletions

View File

@ -406,18 +406,11 @@ static void va_pool_set_allocator(struct mp_image_pool *pool,
mp_image_pool_set_lru(pool);
}
static void flush_output_surfaces(struct priv *p)
{
for (int n = 0; n < MAX_OUTPUT_SURFACES; n++)
mp_image_unrefp(&p->output_surfaces[n]);
p->output_surface = 0;
p->visible_surface = 0;
}
// See flush_surfaces() remarks - the same applies.
static void free_video_specific(struct priv *p)
{
flush_output_surfaces(p);
p->output_surface = 0;
p->visible_surface = 0;
mp_image_unrefp(&p->black_surface);