diff --git a/video/mp_image.c b/video/mp_image.c index 5e2726fd3a..76a117d85a 100644 --- a/video/mp_image.c +++ b/video/mp_image.c @@ -817,6 +817,8 @@ struct AVFrame *mp_image_to_av_frame(struct mp_image *img) frame->hw_frames_ctx = new_ref->hwctx; *new_ref = (struct mp_image){0}; talloc_free(new_ref); + if (frame->format == AV_PIX_FMT_NONE) + av_frame_free(&frame); return frame; }