From patchwork Thu Oct 14 22:13:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 31117 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp7645942ioa; Thu, 14 Oct 2021 15:14:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFaNR1eihbpNuzftJ70oY+qLXiUPqp2+GqYklsnee2JjsFu3eGoDtucjV3WDsMHThvAWIJ X-Received: by 2002:a17:907:7848:: with SMTP id lb8mr2116039ejc.494.1634249686039; Thu, 14 Oct 2021 15:14:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634249686; cv=none; d=google.com; s=arc-20160816; b=FvDdxef7K1805RwOiiZDWwkCk8qIOVwJ29LFroXh3NDknjjeeQzGn2qH8XkbFdLz2L XC9lJVR0r7HvLuyXJnNZ9V9vR+f4Z5zQRqYIJz75Xyj4v+spJ8iwbX8en9ELE9IgaqJQ xrwOm2EGUTiINXmLlkxMV1Ivt6VDRk2oBGV2WTAsE9Bi8DaG/pWontOO5Bze18+3S7qv j6hVV9/c3cr5LdRR7K7mgyaoCzvT2f8XbBTt4s38pfKdL7JqNgryV2TnM1aBD2R3a1Bz sV3nKxi7CKbdSp1/95EJjGSv7v+UOredQT8/Xxvo3I4Nsqe3zA/VjmcPz8AtEe9JghE6 Ocug== 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=qOVx2uQHp9drM45UVyDLNZJ0w+sx0KHfes13jmzIsIg=; b=f/yKN59bo+fEu1S2W0i+tLunRtmFWm7OBnXeRhrDcd85NuVZuYzawuCzawfZbqPvm4 6pxuDAVOGKslrubv7MPglWzU+pgjp1IhQLvNz2Zw6XO5gHyOiOwVpI5SfKe+TfNjsgUd 1LoB9YuXofg2K/d5g1frxFATcYKd0MNWgW/vz6RcD990CgPY1Hk6WPcUZ9kO66I46lgw cL2Qq0pHG3iPnjA14wtHunGV8/By5fTAZxmbGg2ZCryFNKeAzZD8JY3d7VRTaOOyiGnu fNhNGewbIniUP+kNdiHuJzjz4mram+whQb4Fbu8JDYt3oQ3dwMB1QEEhRY+NpQiXX7pV Kbxg== 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 sb15si8475681ejc.427.2021.10.14.15.14.45; Thu, 14 Oct 2021 15:14:46 -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 EBD2C68A9C2; Fri, 15 Oct 2021 01:14:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe02-2.mx.upcmail.net (vie01a-dmta-pe02-2.mx.upcmail.net [62.179.121.158]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CA74B68A199 for ; Fri, 15 Oct 2021 01:14:24 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1mb8zY-00CQCX-0D for ffmpeg-devel@ffmpeg.org; Fri, 15 Oct 2021 00:14:24 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id b8yamqDOrSgGFb8yamFWNF; Fri, 15 Oct 2021 00:13:24 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=f8Q2+96M c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=NEAV23lmAAAA:8 a=pIam29bhSlgd8CgGwi4A:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 15 Oct 2021 00:13:23 +0200 Message-Id: <20211014221323.21096-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211014221323.21096-1-michael@niedermayer.cc> References: <20211014221323.21096-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfCtLTRDVyIG1bNTUOSe3d85PuK+3FiqtFAjU6isP9aUD23kow7asq38nBWUfZcgsBGjmRKEoN4RGqFRtLIbWlbAtS6D9+8Fp3xpS8Ipt/2/vSiXeHuW3 0z0JnnWIcbjpAqYkjxjr2cE4I1UqP33NwfgbWNse4QcyGGgwserd0V9c Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/ttadsp: Fix integer overflows in tta_filter_process_c() 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: eXo4j05S9xfd Fixes: signed integer overflow: 822841647 + 1647055738 cannot be represented in type 'int' Fixes: 39935/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-4592657142251520 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/ttadsp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/ttadsp.c b/libavcodec/ttadsp.c index 1d1443aee05..99dd66a0c2a 100644 --- a/libavcodec/ttadsp.c +++ b/libavcodec/ttadsp.c @@ -47,9 +47,9 @@ static void tta_filter_process_c(int32_t *qmi, int32_t *dx, int32_t *dl, *error = *in; *in += (round >> shift); - dl[4] = -dl[5]; dl[5] = -dl[6]; - dl[6] = *in - dl[7]; dl[7] = *in; - dl[5] += dl[6]; dl[4] += dl[5]; + dl[4] = -(unsigned)dl[5]; dl[5] = -(unsigned)dl[6]; + dl[6] = *in -(unsigned)dl[7]; dl[7] = *in; + dl[5] += (unsigned)dl[6]; dl[4] += (unsigned)dl[5]; } av_cold void ff_ttadsp_init(TTADSPContext *c)