History

vo_vaapi: fix use-after-free when quitting

p->output_surfaces gets freed by destroy_frame when quitting

llyyr committed 2 years ago

Commit 0aec73d1 parent ff73aeb1 file · +2 −9Browse files

Unified · Split

video/out/vo_vaapi.c+2−9
@@ -406,18 +406,11 @@ static void va_pool_set_allocator(struct mp_image_pool *pool, · 405 unmodified lines
406 mp_image_pool_set_lru(pool);406 mp_image_pool_set_lru(pool);
407}407}
408 408
409static void flush_output_surfaces(struct priv *p)
410{
411 for (int n = 0; n < MAX_OUTPUT_SURFACES; n++)
412 mp_image_unrefp(&p->output_surfaces[n]);
413 p->output_surface = 0;
414 p->visible_surface = 0;
415}
416
417// See flush_surfaces() remarks - the same applies.409// See flush_surfaces() remarks - the same applies.
418static void free_video_specific(struct priv *p)410static void free_video_specific(struct priv *p)
419{411{
420 flush_output_surfaces(p);412 p->output_surface = 0;
413 p->visible_surface = 0;
421 414
422 mp_image_unrefp(&p->black_surface);415 mp_image_unrefp(&p->black_surface);
423 416

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t