[FFmpeg-cvslog] avcodec/adxdec: add support for 6 channels

Paul B Mahol git at videolan.org
Wed Sep 6 00:25:43 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Sep  5 14:46:39 2023 +0200| [39f6d9c5c1272da15fcc6ca9186ce40661326e84] | committer: Paul B Mahol

avcodec/adxdec: add support for 6 channels

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

 libavcodec/adx.h    | 4 +++-
 libavcodec/adxdec.c | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/adx.h b/libavcodec/adx.h
index 8d5e0869ae..60ce07ad61 100644
--- a/libavcodec/adx.h
+++ b/libavcodec/adx.h
@@ -35,9 +35,11 @@ typedef struct ADXChannelState {
     int s1,s2;
 } ADXChannelState;
 
+#define MAX_CHANNELS 6
+
 typedef struct ADXContext {
     int channels;
-    ADXChannelState prev[2];
+    ADXChannelState prev[MAX_CHANNELS];
     int header_parsed;
     int eof;
     int cutoff;
diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c
index 97a7e59686..4300dede5e 100644
--- a/libavcodec/adxdec.c
+++ b/libavcodec/adxdec.c
@@ -70,7 +70,7 @@ static int adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
 
     /* channels */
     channels = buf[7];
-    if (channels <= 0 || channels > 2)
+    if (channels <= 0 || channels > MAX_CHANNELS)
         return AVERROR_INVALIDDATA;
 
     if (avctx->ch_layout.nb_channels != channels) {



More information about the ffmpeg-cvslog mailing list