From patchwork Tue Sep 5 12:59:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 43557 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4f16:b0:149:dfde:5c0a with SMTP id gi22csp1819946pzb; Tue, 5 Sep 2023 05:52:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/mc5ha9XO46L2N4cnKf+u4KEZs2qnd4s4PcLA+nYjwfqh5lXSTPg/L+nAJD4qvvMDAU+S X-Received: by 2002:a05:6512:31c8:b0:500:7a23:720b with SMTP id j8-20020a05651231c800b005007a23720bmr11295284lfe.55.1693918339840; Tue, 05 Sep 2023 05:52:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693918339; cv=none; d=google.com; s=arc-20160816; b=nzDux9eK6SfihcxGlkAiWTpXBe4FkZQm7E7E5ysk+yC+gltNCxQK3LN33Z8ThBe2Kp wnxO2ZE4Ra+W3Fcaet6fsdlu/QWZX/dQ2t18lrGLtY+bcn8QKT2EF/N4HjddOjf7LgGN 63yHFEe6Cj82rGeC4rPjVqu+FdRRpB+z1V+FqFs2JMI/yAnie5Qg3R2fSAhzhokDjlMM WsSJ6Q8laeUMbI++4PZqaNaL2pkBJWu1MJTkRH5INfIg/PgjxwJrUXIQhbiIg9f2q+Bs QcHVi6lwvWZhyhdLvLz5lJLU/zRPyl6Z39mj71uc1NvgOJeBiKVsOjYXewas12Zs54EU o/Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to; bh=dvGdZQ9MrK7G3ClnKN0k6S36ZHLAmZaqmvpYGkuMyyw=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=n1YJ1TztgKjnxUXFxTSHRyPKM9tl3jCC3UiI25rsTiqwHBui4u9hGRDkTe1iwBpY97 lWW0Koz9Q1WodS3fUvI9zyIXWlwt4EfUhGqevkStTMiFp2i2awFJ/mO1a3OU41wbufrt epp4qiOGq+kjiy8SMGNuIB4ukFwFsNupyp7b07K+LtvDSahQCaNp79xtSl6nJEFhOPUJ FZulcshPMYXidjn3Dmw4m6rBcedC18wxSscrd7/uQPSKxpQiEY5IHl0V1fsFL0WVOw3k BFXRvkBwnKJwowXG52w1ij8as60gDy53CLHVc9rKtZjZIYxe/EUsISgl+rRTZ71ThrHs swyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b=bECkaNcN; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id gw18-20020a170906f15200b00993860a6d36si637922ejb.374.2023.09.05.05.52.19; Tue, 05 Sep 2023 05:52:19 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b=bECkaNcN; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 01DEE68C7C5; Tue, 5 Sep 2023 15:52:16 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F2B6768C7C5 for ; Tue, 5 Sep 2023 15:52:08 +0300 (EEST) Received: by mail-vs1-f41.google.com with SMTP id ada2fe7eead31-44e8984b724so1483748137.1 for ; Tue, 05 Sep 2023 05:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693918327; x=1694523127; darn=ffmpeg.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=lcmGLSuaeCkMkhu8VkQ6SqMclItWV/ES+ibNQWyj5V8=; b=bECkaNcNwTS/b52YWO4I17prBVNRy4tYWYjs7Abc+uEMn3clA5iExlCelJ+X7zqbWW ktI0lq0gD6i2kO5bO+0uh4uBl748UJBQikuKVEkgKfKgJeFBmEVSM/EY778Bytk235+Y W+xacye1O5HWTA1AZN6+I10lZLub7f/0sAZw6zb1jH49VSP2iy8YnQcFW0FsVeWQoqme c6tSAwt4LDtjB1yuUTyAwTD4AWjl9XowGGqTtLsQpxr8OCl2GUQXS9SSUn8C3jP0NCc1 YfvZFkVxertM+W11ubEhlTswfrbKjT5YXxgts2XeqBwvZcHxDiBInrHP+i3n5CqetRtw XAow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693918327; x=1694523127; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=lcmGLSuaeCkMkhu8VkQ6SqMclItWV/ES+ibNQWyj5V8=; b=WqOhUkWBz41t/X+tHC/kEU2by5b7fNPWl+OxAh9fz5gxtnXKUMbLJvM1DJ0G+VzlDi T9hqo/AMl6F000gwC3+ps98yXyr3o1R9jvRewFgXJ5uCb1wsT1EW3VmuMChDvlXmaD6r uMxVS/2Top9ihYIivoh1VEd3g3AfWV1Socdbjyjh2DlZHzOEhPMROhq1WhCc4fXqKVJC CNrRczJ9pIj6KFjnkwOQnDVbqrW8eXEMFCT9yASWXpNfRKvLIMgsCQKBMoRsF8iljoUq eSGtWQWKjAuSd0vrxPgjNanIGei4gozayP6lKQd81gD/GvYVRTgWDJY9Q089lkHzqleq +S2A== X-Gm-Message-State: AOJu0YxDmOMQJ5RT9+TYpExQPk+3NGjucvgGCu+ljJHv3SCQcivNY9iB Sym4ctQkKBiugHUBRVPjOQ7+qGbfP6NskoG64mb/Sds9Y5Y= X-Received: by 2002:a05:6102:5594:b0:44e:942a:e563 with SMTP id dc20-20020a056102559400b0044e942ae563mr9587876vsb.0.1693918327362; Tue, 05 Sep 2023 05:52:07 -0700 (PDT) MIME-Version: 1.0 From: Paul B Mahol Date: Tue, 5 Sep 2023 14:59:28 +0200 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [FFmpeg-devel] [PATCH] avcodec/adxdec: support for 6 channels X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: yriUZxuZITCS Attached. From b4d48134a026aaafddf753a1470f03e56b233f57 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Tue, 5 Sep 2023 14:46:39 +0200 Subject: [PATCH] avcodec/adxdec: add support for 6 channels Signed-off-by: Paul B Mahol --- 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