Without this, it's possible to mux VP9 into MOV without passing -strict -2.
This tightens the check to restrict VP9 to MODE_MP4 only.

Based on the discussion with James Almer on the experimental FLAC in MP4
muxing patch.
>From 47f74ca9269d2bddccd9d273d6739798f9bfd0b7 Mon Sep 17 00:00:00 2001
From: Matthew Gregan <kine...@flim.org>
Date: Fri, 18 Nov 2016 16:29:42 +1300
Subject: [PATCH] Restrict experimental VP9 support to MODE_MP4.

Signed-off-by: Matthew Gregan <kine...@flim.org>
---
 libavformat/movenc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 5452ff7..a114d71 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5714,8 +5714,11 @@ static int mov_init(AVFormatContext *s)
                         pix_fmt == AV_PIX_FMT_MONOWHITE ||
                         pix_fmt == AV_PIX_FMT_MONOBLACK;
             }
-            if (track->mode == MODE_MP4 &&
-                track->par->codec_id == AV_CODEC_ID_VP9) {
+            if (track->par->codec_id == AV_CODEC_ID_VP9) {
+                if (track->mode != MODE_MP4) {
+                    av_log(s, AV_LOG_ERROR, "VP9 only supported in MP4.\n");
+                    return AVERROR(EINVAL);
+                }
                 if (s->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
                     av_log(s, AV_LOG_ERROR,
                            "VP9 in MP4 support is experimental, add "
-- 
2.10.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to