[FFmpeg-cvslog] lavf/cafenc: Only allow mono and stereo for Opus.

Carl Eugen Hoyos git at videolan.org
Wed Oct 18 00:01:22 EEST 2017


ffmpeg | branch: master | Carl Eugen Hoyos <ceffmpeg at gmail.com> | Tue Oct 17 23:00:07 2017 +0200| [d180fce6c707d22a69206c1f8efeabd38424de95] | committer: Carl Eugen Hoyos

lavf/cafenc: Only allow mono and stereo for Opus.

Found-by: James Almer

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d180fce6c707d22a69206c1f8efeabd38424de95
---

 libavformat/cafenc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/cafenc.c b/libavformat/cafenc.c
index 211b046563..0f7c4ebbb3 100644
--- a/libavformat/cafenc.c
+++ b/libavformat/cafenc.c
@@ -123,6 +123,11 @@ static int caf_write_header(AVFormatContext *s)
         return AVERROR_PATCHWELCOME;
     }
 
+    if (par->codec_id == AV_CODEC_ID_OPUS && par->channels > 2) {
+        av_log(s, AV_LOG_ERROR, "Only mono and stereo are supported for Opus\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     if (!codec_tag) {
         av_log(s, AV_LOG_ERROR, "unsupported codec\n");
         return AVERROR_INVALIDDATA;



More information about the ffmpeg-cvslog mailing list