summaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>2017-10-17 23:00:07 +0200
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>2017-10-17 23:00:07 +0200
commitd180fce6c707d22a69206c1f8efeabd38424de95 (patch)
treef62013ed7472376f80caa458873d9071ad118fc9 /libavformat
parenta6cfc287a06c7f75709fc9dfcdcc9cce54eaeca6 (diff)
downloadffmpeg-streaming-d180fce6c707d22a69206c1f8efeabd38424de95.zip
ffmpeg-streaming-d180fce6c707d22a69206c1f8efeabd38424de95.tar.gz
lavf/cafenc: Only allow mono and stereo for Opus.
Found-by: James Almer
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/cafenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/cafenc.c b/libavformat/cafenc.c
index 211b046..0f7c4eb 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;
OpenPOWER on IntegriCloud