mirror of https://github.com/mpv-player/mpv
vo_vaapi: fix use-after-free when quitting
p->output_surfaces gets freed by destroy_frame when quitting
This commit is contained in:
parent
ff73aeb5c3
commit
0aec73d1bf
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue