From patchwork Sun Apr 25 19:40:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 27369 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:5014:0:0:0:0:0 with SMTP id e20csp3374380iob; Sun, 25 Apr 2021 12:41:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwn5I1GKQTfGb/pi/sWn+gsdeH+v9is+9qBJipWaZM3gX37rNk8pI9NGkXw6hY7jZCKTny4 X-Received: by 2002:a05:6402:1a2f:: with SMTP id be15mr9856639edb.207.1619379712461; Sun, 25 Apr 2021 12:41:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619379712; cv=none; d=google.com; s=arc-20160816; b=SKdiPyqzvsScxqhMZV3ANobAb/+hwCC+v1ekd7MukAS4xHkwFG6KLTVIDl/eoshqGo xuPrcJwfChw+tToClVWm6pFt+Tn8s4XOiUj8BJtKhk+x7TFZP7UFeT2jR4QPZiG6P7DZ 7u0CUaEnoN/tdYdsdTUjQIDgzTvY0NGMrCm57NCSP9+EXOGo3qSr7Odrrra/1n4qxzPG Fn8oWN89so+SAWcbES/maGuDigGUBSiNZsKIh23SuzUtgoPkdshsXTLzDQoeXLHLj/4G +qQIsx/vqYwoGR+UcxsBErB2sFEn9owBkY9SPkF22pHYXcpIWR2py07w7PDLaDJseVaW 4hoQ== 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=E7VTfUh+o66vfy8hcAitv4OUdyyVqecyMIX81ESdsS0=; b=vwe1hkkCq1QKl9jZlgt4VnAzbqYmlpWhJyct1FtRs6IuTxbEpeOzg+NIAmtZZHR+7H 0IaVleEu1Xv++AyJjMT5Xxj1UNvdi0/mhQzAr0WOohMUe7TThkfxgCDY857tEftSzmTb toBb+Z6Z7CuuyyUJrxZ4KouT2ktVVKkErAzgSpUoec2WQv/e4t7bxax8vX0p+C0kh1UT 2O8xxo0uk0s/ZjaEeQhuI/6bcWLgTSVZ5N23BBvaVAlTxNS4zVC/yEJGMFcuETUlDvGr MWi97baxUYZu7a8j2yyTaD8mE21clXr+3NL42eMWdEQvVz859ybkIU76gaqspWi1Zs/g Z87A== 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 s21si11436366ejm.689.2021.04.25.12.41.51; Sun, 25 Apr 2021 12:41:52 -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 19243688081; Sun, 25 Apr 2021 22:41:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-1.mx.upcmail.net (vie01a-dmta-pe05-1.mx.upcmail.net [84.116.36.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 326DA680CDE for ; Sun, 25 Apr 2021 22:41:15 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe05.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1lakd1-007rjs-0K for ffmpeg-devel@ffmpeg.org; Sun, 25 Apr 2021 21:41:15 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id akc3lFjc5ljeHakc3lu0iE; Sun, 25 Apr 2021 21:40:15 +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=P03E6L4JOTLWywOfdN0A:9 a=1fhp2MxaeJtTNGEnv6mo:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=SsAZrZ5W_gNWK9tOzrEV:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 25 Apr 2021 21:40:13 +0200 Message-Id: <20210425194014.957-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210425194014.957-1-michael@niedermayer.cc> References: <20210425194014.957-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfI1yxvtNz1tA485sq5Ym0PuKZ2ezBhjsnqFlPrV0M78Qf1UR21/vo2fIF3r7trKSgM4ngKtp7E3NGoXFtDbyr1i+vQ7CMkswNX20kPnWenN1jWiBn37Q wwkYwBCJMcOmYiV6544YluTdwryJbQBZZskP4p/oi1jhVg8TTdKAPrbs Subject: [FFmpeg-devel] [PATCH 5/6] avformat/qcp: Avoid negative nb_rates 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: l3k+T7CW1RyL Fixes: signed integer overflow: 2 * -1725947872 cannot be represented in type 'int' Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_QCP_fuzzer-6726807632084992 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/qcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/qcp.c b/libavformat/qcp.c index 168030dc16..4478875f2d 100644 --- a/libavformat/qcp.c +++ b/libavformat/qcp.c @@ -93,7 +93,8 @@ static int qcp_read_header(AVFormatContext *s) QCPContext *c = s->priv_data; AVStream *st = avformat_new_stream(s, NULL); uint8_t buf[16]; - int i, nb_rates; + int i; + unsigned nb_rates; if (!st) return AVERROR(ENOMEM);