diff options
author | wm4 <wm4@nowhere> | 2017-06-08 21:17:12 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-06-08 21:52:07 +0200 |
commit | 5521d48b4b2e9fda1b6019c35ca329cccd81b5ac (patch) | |
tree | 8f7ff33251d87909a3280a3bf0c9bb24fd4a16e1 | |
parent | 0754cbc83eb030ed3c0f0666e8b7c2481631e513 (diff) | |
download | mpv-5521d48b4b2e9fda1b6019c35ca329cccd81b5ac.tar.bz2 mpv-5521d48b4b2e9fda1b6019c35ca329cccd81b5ac.tar.xz |
mp_image: refuse to convert frames of unknown format to AVFrame
This could happen with some "special" hwaccel formats, that exist in
mpv, but not libavutil.
-rw-r--r-- | video/mp_image.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; } |