From patchwork Sat May 25 19:03:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= X-Patchwork-Id: 49262 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2445456vqf; Sat, 25 May 2024 12:03:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVvw/TC4GTw09LXq+1Dh6x3olZFwiS78Ov0pBDWTaM3u9usJDTygEEE/G2W4x/N2+GNMV3/3GdBbK6JRPIJMx9xYYcDptdsxx/ACg== X-Google-Smtp-Source: AGHT+IFF68YKPNwrYaUFYslNHAA5N29Y/EtTFwKzwo3+7WCZriSYw2Ohb6XB5OAllOLWVh2fG8PA X-Received: by 2002:a05:6402:901:b0:579:be3b:562a with SMTP id 4fb4d7f45d1cf-579be3b56b5mr1229668a12.19.1716663823543; Sat, 25 May 2024 12:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716663823; cv=none; d=google.com; s=arc-20160816; b=PInZNDTgFcBe8NzBRo83c7uXizAgg3WBfeS5wPmb7P7ZrhdgEKdOPBbRM0lF4tf6dU HLR/0eSRytw3at9korws0+3DEx1jQ3hX8ZrPvl8c0ZjobIIw/JJav84+Wn9USJSKiY3p lZG80+RypudowJ+KkmjCZJ3hPtVYTZ+c4RfgpJ7HNGbFH5zlHiSXvd7kDFfD8B6/+mf/ PXDUQplkPLclBqYN8lzklkkWdOrXF1fnvlzVeE3ZmlW0JeJdSPOijxZIMvKkSZbb5RtQ 44mLAsHqdoe4Qj3ELZPq+ZhLW8ST1jzuSW32UZmhPDNLWGN01eKkFGfNmHXcMw72Pfi3 3/MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=H49za6zalJD72Q6r+8rC9ICFVijzpkQuBjRKCLvZdwg=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=hXnkzviKAzKfIwrJcA1TgBFyODOQC8ObwVjJxaJ2eUEJrpYZFt7EdPOmG09KSjxVqX 2q/oelWD5rCjHobaGgLrqIf7q/5nhdHrbXNYXYCmgb+Y9qVmP8jakw9iipXqFZss0UnJ 1Bg287X+ORwA1/jtjw3B04Unl68qxWrXS9k/5Na0gEdvzXncg6/ZJP9RivdWYlHONZv6 uRCVDv+yvBURmY4ZBMuUByam2X0era0wb0wD65RWOVyVd5xJx1uShY1bbW+zUv2BhdmH OnilWL9l+5qOCVfKZcz2wb0JzPycf37pxpCfOF5ZBMmRK2FPxeqFFCMeAtbgjztMYDmc 0RSw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-578524b4588si2137514a12.513.2024.05.25.12.03.43; Sat, 25 May 2024 12:03:43 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 73A4E68D4D6; Sat, 25 May 2024 22:03:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0548E68D36D for ; Sat, 25 May 2024 22:03:33 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 5C5BAC006B for ; Sat, 25 May 2024 22:03:33 +0300 (EEST) From: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Sat, 25 May 2024 22:03:33 +0300 Message-ID: <20240525190333.95781-1-remi@remlab.net> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] lavc/sbrdsp: fix potential overflow in noise table 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: MywOTj846NSL Since the SBR noise application optimisations are currently restricted to hardware with 128-bit vectors, and use a quadruple multipler, they can load up to 16 32-bit elements. But the "loads" are of 2 segments, or 16 pairs of single precision float. Thus we need to expand the dupiclated section of the noise table from 2x8 to 2x16 to avoid overflows. --- libavcodec/sbrdsp_template.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/sbrdsp_template.c b/libavcodec/sbrdsp_template.c index 80d535cbfa..0f731ba50d 100644 --- a/libavcodec/sbrdsp_template.c +++ b/libavcodec/sbrdsp_template.c @@ -371,4 +371,10 @@ const attribute_visibility_hidden DECLARE_ALIGNED(16, INTFLOAT, AAC_RENAME(ff_sb {Q31( 0.14130051758487f), Q31(-0.95090983575689f)}, {Q31(-0.47005496701697f), Q31(-0.37340549728647f)}, {Q31( 0.80705063769351f), Q31( 0.29653668284408f)}, {Q31(-0.38981478896926f), Q31( 0.89572605717087f)}, {Q31(-0.01053049862020f), Q31(-0.66959058036166f)}, {Q31(-0.91266367957293f), Q31(-0.11522938140034f)}, +#if ARCH_RISCV +{Q31( 0.54840422910309f), Q31( 0.75221367176302f)}, {Q31( 0.40009252867955f), Q31(-0.98929400334421f)}, +{Q31(-0.99867974711855f), Q31(-0.88147068645358f)}, {Q31(-0.95531076805040f), Q31( 0.90908757154593f)}, +{Q31(-0.45725933317144f), Q31(-0.56716323646760f)}, {Q31(-0.72929675029275f), Q31(-0.98008272727324f)}, +{Q31( 0.75622801399036f), Q31( 0.20950329995549f)}, {Q31( 0.07069442601050f), Q31(-0.78247898470706f)}, +#endif };