From patchwork Tue Apr 27 19:21:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 27442 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6109:0:0:0:0:0 with SMTP id v9csp1242219iob; Tue, 27 Apr 2021 12:28:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8DrQXVNKf0WfuGxCmHssmQCKOLk+AkPcwcvyWIB6mVd504zyK915svV21oWHMPj84eKha X-Received: by 2002:a17:907:ea7:: with SMTP id ho39mr25146148ejc.315.1619551698055; Tue, 27 Apr 2021 12:28:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619551698; cv=none; d=google.com; s=arc-20160816; b=ZGTep9eP0lvZV/ON0Z9lfCq5JpW/c9z6tvGWWA6T7jvbzKV+RO0BeWrRStIPGiPj// 2g5VtXEMb7YgARIMv5IBj8qvqUTje17grlEDH4G/utstfm86jQVMlIfik5bdzfgNyZjE 1n6rdsOhRr8egoYHilf0Y913iR1+yEZEpF8yTNFNXmj57hlcBF633vdF+UQqpAbcIqmT IWQLwwljtfjW7YAeDp+mvKAEM0ib3Owqe3Tdc9kPOpM3gXmKW6XC+Vl72cm45qdZt2DB mDxte1mYlOOgAzGx5PGF4jrYC4UoOpKE3xNjLRJtF6cUevDgXBTsU0sGrMSFeEEDNRpf PUhQ== 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=3/OPKPJMtstrLg1uykfv9VP1zwdHwkFIJe1qddREkwI=; b=Td5Zcj5rP+1wUB0DuQZ9bHpccvJN/m3Hgq01s1Hi0aJcjxWRalWMLBAnha4rEYAcjz pXFJsT94xKKIUL04byDqdwd1RBE0dgOnOpCflwuCOz1I55cxxAbiyqFyQgAfCIMyeWwr mFxA2G66uAb+TxkHrsfw0X/79Tc062N7LMBFNlkpPJ8ZB0XdFNFOMX+i31/oucq6QJ2/ u7y8nx9vnW89y1z9LyL0pDsZ3TjtNTkoX26sV1jczY1E8mvg+bSC+lmAEgkxPSre6w0H 48GkDkN1foQF1wKBkS6zr9WHjQDMBwcC7QeST+jajoQmIDK9zGRp1ZESNdV8JX3cd3Dn h91w== 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 kb17si670109ejb.294.2021.04.27.12.28.17; Tue, 27 Apr 2021 12:28:18 -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 A57B468026B; Tue, 27 Apr 2021 22:28:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe01-3.mx.upcmail.net (vie01a-dmta-pe01-3.mx.upcmail.net [62.179.121.156]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C9C4C680835 for ; Tue, 27 Apr 2021 22:28:07 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1lbTI3-009HbL-Vp for ffmpeg-devel@ffmpeg.org; Tue, 27 Apr 2021 21:22:35 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id bTH6lEuQsljeHbTH6lFofv; Tue, 27 Apr 2021 21:21:36 +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=BoHjPrf5 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=nZOtpAppAAAA:20 a=_gu8nYYhDGt3qoTxneIA:9 a=1fhp2MxaeJtTNGEnv6mo:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=SsAZrZ5W_gNWK9tOzrEV:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 27 Apr 2021 21:21:35 +0200 Message-Id: <20210427192135.17286-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210427192135.17286-1-michael@niedermayer.cc> References: <20210427192135.17286-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfGTdjo5T48xJeOVTt/aK4+mcWMifwLzX2ZOzvKEUO/ITF/2zvhDuslxblLVbzIIPZU0a+fQJM0RGFMvLAq2Lv9XrMKF4+NG86T82GI4PXHp7Y58oMUvW Kj7eUfkxZXnsaMOlQm0G40Qs1bKb7EkQlX6eovu70xNEJLDyiqBeJ80P Subject: [FFmpeg-devel] [PATCH 4/4] avformat/wavdec: Use 64bit in new_pos computation 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: J8fOULm75cFj Fixes: signed integer overflow: 129 * 16711680 cannot be represented in type 'int' Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-6742285317439488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/wavdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index e11535b6ae..af32d15092 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -718,7 +718,7 @@ smv_retry: if (wav->smv_last_stream) { uint64_t old_pos = avio_tell(s->pb); uint64_t new_pos = wav->smv_data_ofs + - wav->smv_block * wav->smv_block_size; + wav->smv_block * (int64_t)wav->smv_block_size; if (avio_seek(s->pb, new_pos, SEEK_SET) < 0) { ret = AVERROR_EOF; goto smv_out;