Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Paul B Mahol <onemda@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] avcodec/adxdec: support for 6 channels
Date: Tue, 5 Sep 2023 14:59:28 +0200
Message-ID: <CAPYw7P5nJPHtX8p_eEC81o8VUTarccg6Ti3-wgp9gVJiROGcog@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 10 bytes --]

Attached.

[-- Attachment #2: 0001-avcodec-adxdec-add-support-for-6-channels.patch --]
[-- Type: text/x-patch, Size: 1262 bytes --]

From b4d48134a026aaafddf753a1470f03e56b233f57 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Tue, 5 Sep 2023 14:46:39 +0200
Subject: [PATCH] avcodec/adxdec: add support for 6 channels

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 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) {
-- 
2.39.1


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

                 reply	other threads:[~2023-09-05 12:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPYw7P5nJPHtX8p_eEC81o8VUTarccg6Ti3-wgp9gVJiROGcog@mail.gmail.com \
    --to=onemda@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git