vo_vaapi: fix use-after-free of current frame

This was forgotten when switching vo_vaapi from using draw_image to
draw_frame API

Fixes: 0b70598358 ("vo: fully replace draw_image with draw_frame")
This commit is contained in:
llyyr 2024-05-28 18:56:01 +05:30 committed by sfan5
parent 15ea0d1987
commit ff73aeb5c3
1 changed files with 1 additions and 3 deletions

View File

@ -572,14 +572,12 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
struct mp_image *dst = p->swdec_surfaces[p->output_surface];
if (!dst || va_surface_upload(p, dst, mpi) < 0) {
MP_WARN(vo, "Could not upload surface.\n");
talloc_free(mpi);
return;
}
mp_image_copy_attributes(dst, mpi);
mpi = mp_image_new_ref(dst);
mpi = dst;
}
talloc_free(p->output_surfaces[p->output_surface]);
p->output_surfaces[p->output_surface] = mpi;
draw_osd(vo);