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
406406 mp_image_pool_set_lru(pool);
407407 }
408408
409−static 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−
417409 // See flush_surfaces() remarks - the same applies.
418410 static void free_video_specific(struct priv *p)
419411 {
420− flush_output_surfaces(p);
412+ p->output_surface = 0;
413+ p->visible_surface = 0;
421414
422415 mp_image_unrefp(&p->black_surface);
423416

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