summaryrefslogtreecommitdiff
path: root/libavformat/cafdec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2017-09-19 23:04:55 -0300
committerJames Almer <jamrial@gmail.com>2017-09-19 23:06:42 -0300
commit5a3b602acda68fe5ca09082dc753179450a97a13 (patch)
tree5132d564daa90f2679f40d7d5e4787f80fe3e416 /libavformat/cafdec.c
parentb4093e60c51af493a6dad7819264ef769736227f (diff)
downloadffmpeg-5a3b602acda68fe5ca09082dc753179450a97a13.tar.gz
avformat/cafdec: reject multichannel Opus streams
Multichannel Opus streams require channel mapping information in extradata. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/cafdec.c')
-rw-r--r--libavformat/cafdec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index 4e47addc02..7652d9e238 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -167,6 +167,12 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size)
avio_skip(pb, size - ALAC_NEW_KUKI);
}
} else if (st->codecpar->codec_id == AV_CODEC_ID_OPUS) {
+ // The data layout for Opus is currently unknown, so we do not export
+ // extradata at all. Multichannel streams are not supported.
+ if (st->codecpar->channels > 2) {
+ avpriv_request_sample(s, "multichannel Opus in CAF");
+ return AVERROR_PATCHWELCOME;
+ }
avio_skip(pb, size);
} else {
av_freep(&st->codecpar->extradata);