From patchwork Sun Mar 26 22:26:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 40850 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7a30:b0:df:834d:2c1a with SMTP id t48csp886022pzh; Sun, 26 Mar 2023 15:27:13 -0700 (PDT) X-Google-Smtp-Source: AKy350bZfqKnasm9e4ayRD5OY9AxOW0YJEy+qPSadCoV47UYPd6H7yesVQdW65PllEl6QrbF6ytM X-Received: by 2002:a17:907:2ced:b0:8f5:8da0:a482 with SMTP id hz13-20020a1709072ced00b008f58da0a482mr8301940ejc.25.1679869633759; Sun, 26 Mar 2023 15:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679869633; cv=none; d=google.com; s=arc-20160816; b=DmTJEVlLY34cBhWYw2T56fN9oLvp01DNTsFmXzYhF2vqLcu9Ch7a63NDwntNkI5VGH K5NnkfDlUYrL6h8YJ/OuBFvD48yhjXee9Rc5fc0IylDTWLQZgee1yupyyOxAva+u049n vF3qg8BkOm/WF05f3kh7vS7jHqCwsKEdJTQVYxxLuGVQmKUgwFao526aP134KUqeDlGW R9tnXYtFV/PXHwCurdEBYkc0t3y3LhxkmDpvspc+fPgjPursk2zf416daahKLX88UStv WANTLEPce1FYNVwWJWBogUNM5oAoPMHCFPixL82cfJBGUUr5TKwMLr1bzjDVzaKeOw92 sHSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=+9ihd0foudZekCkr08dLWX6Ygmwg5JQNY2pU1WqxyuY=; b=NBH4Gh98jbL0c2/Y00xaVNhvBC/C43Vym5jKHbDPwv3w0/Txe/U2iz/nuXXol/DGgJ MOEH4M/PEU+syrUSoKNQigovCaxnLJlWdpH53gVp/L22zysQeh7U/NhKaKK/TSfMZpqJ qGJstJ3Q21jfuC/Vsl/Anf4Xjvdub0ZZSE6hACY0yul50Sw6zeysj7sp3cB73lN+j7Ex 34W4gDuYhyVnZQe9xtBC2oA3aRHLZUbLt5c82fxrJuJLwq9dqlKc3Yv4SxGrp2uy5tMp d2Uu9zandEufU+vQxrSNyb9MZFVduT8usZEo97DEdxcjuBsn7dWyFuOtADVsCmn2/Xtb IvBA== 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 h18-20020a1709063c1200b0093c96e480d1si9854816ejg.437.2023.03.26.15.27.13; Sun, 26 Mar 2023 15:27:13 -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 9720268C678; Mon, 27 Mar 2023 01:26:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C847A68C3FF for ; Mon, 27 Mar 2023 01:26:45 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id DDBF020005 for ; Sun, 26 Mar 2023 22:26:44 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 Mar 2023 00:26:41 +0200 Message-Id: <20230326222642.2489-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230326222642.2489-1-michael@niedermayer.cc> References: <20230326222642.2489-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 3/4] avcodec/g729postfilter: Limit shift in long term filter 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: s1sbowlxWoI8 Fixes: shift exponent 34 is too large for 32-bit type 'int' Fixes: 57389/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ACELP_KELVIN_fuzzer-6229522659016704 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/g729postfilter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/g729postfilter.c b/libavcodec/g729postfilter.c index f3cacbac05b..26e937f0baf 100644 --- a/libavcodec/g729postfilter.c +++ b/libavcodec/g729postfilter.c @@ -353,7 +353,7 @@ static int16_t long_term_filter(AudioDSPContext *adsp, int pitch_delay_int, if (tmp > 0) L_temp0 >>= tmp; else - L_temp1 >>= -tmp; + L_temp1 >>= FFMIN(-tmp, 31); /* Check if longer filter increases the values of R'(k). */ if (L_temp1 > L_temp0) {