[FFmpeg-cvslog] avcodec/opus: Check count of ambisonic channels

Michael Niedermayer git at videolan.org
Fri Feb 17 12:31:47 EET 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Feb 17 11:18:30 2017 +0100| [04e611474b9a82ddc8a53b08e80401379a40e410] | committer: Michael Niedermayer

avcodec/opus: Check count of ambisonic channels

https://tools.ietf.org/html/draft-ietf-codec-ambisonics-01#section-3.1
specifies the maximum as 227

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/opus.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/opus.c b/libavcodec/opus.c
index 07e70fd..5847e88 100644
--- a/libavcodec/opus.c
+++ b/libavcodec/opus.c
@@ -381,6 +381,10 @@ av_cold int ff_opus_parse_extradata(AVCodecContext *avctx,
                        " for nonnegative integer n\n");
                 return AVERROR_INVALIDDATA;
             }
+            if (channels > 227) {
+                av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
+                return AVERROR_INVALIDDATA;
+            }
             layout = 0;
         } else
             layout = 0;



More information about the ffmpeg-cvslog mailing list