]> git.sesse.net Git - ffmpeg/commitdiff
avformat/cafdec: reject multichannel Opus streams
authorAnton Khirnov <anton@khirnov.net>
Wed, 20 Sep 2017 02:04:55 +0000 (23:04 -0300)
committerJames Almer <jamrial@gmail.com>
Wed, 20 Sep 2017 02:06:42 +0000 (23:06 -0300)
Multichannel Opus streams require channel mapping information in extradata.

Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/cafdec.c

index 4e47addc02678dd5b9ec6f204461bf22d41cd6fb..7652d9e238597f1ca673b394d761f00c26a1d52d 100644 (file)
@@ -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);