From patchwork Sat Sep 17 21:15:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 37994 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp389588pzh; Sat, 17 Sep 2022 14:17:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4/oLLkc1rC9W4cn0NCP11Zw/+bY+xCqUwy7ZjdMJB+y9mxnsifvu8VCzrxEGvLNmSZy5Q3 X-Received: by 2002:a17:906:8a44:b0:780:b567:63cf with SMTP id gx4-20020a1709068a4400b00780b56763cfmr5638635ejc.306.1663449432837; Sat, 17 Sep 2022 14:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663449432; cv=none; d=google.com; s=arc-20160816; b=fu1JGttXF2cS2YBX0Gi4+kNQN0ijLJkoQ5BmKHXOMkhl2nuPCYBxzMHvDehgDvckdM BL/MLNyPkm/Uv0DYeI6YbFqr3fFEAPviKXGAeHpUrQT8Hizh9veIKN+CiMvg07kfzXop 0T4WjpxctiKBP4PbxpkeuLxldtVDLQfe8Lo4YWUu/tkR5Gq4S//R8XSjnzkLVC6k1w9O yUA4MAGV9REuh3iAlOggHnAA6J9TpcO8+/7+lwznSdBrhVmg2vQnm86yjgEHu/POekyK PzaLiuIXg/Zp/TMtWwyWgT6sDh76hh9lsxL0AFRZUsQA9Lh36tZ7SDMJpSGeGGKPZ1Ig zJuw== 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=F8Ixvi2p7OdTY0Q6jlOfI2iZPULr0yBQwrI4fQjwGl4=; b=fUSpb3SVg8NEYFLi+XdCLsBNaqDS9rOTCnl+Zof2t5YnT/rR25pu3HbhGndkAaTZ+N 1tcjGk7BaiQW/zAwA5HrxwpNtQo/0Ut46Z7gLq56rCFlxrKgPkhuk/auWVW5eROmFpoX IbcKisQVrmIWmZnQfnuJ7cexa61GfasFKsFvdR08dEkoFpq8z/dGF/E8erwDcUipO4Ch lIefVAcb+kQVakbbD5JweRdiD3I7EI9YfqniNQabNiIgjN1hhElJZuIt7782S4yKiixA WNvuxwNkCkddHq8MsMB4pruR1NURrecrMiU6l72N+Uhj8bHgDCKzdjqdY9RUQ1lfB3Ub R89Q== 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 j25-20020aa7ca59000000b004533484fe75si4567165edt.315.2022.09.17.14.17.12; Sat, 17 Sep 2022 14:17:12 -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 1816168BBEC; Sun, 18 Sep 2022 00:16:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-at01-2.mx.upcmail.net (vie01a-dmta-at01-2.mx.upcmail.net [62.179.121.146]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 00D0468BB5A for ; Sun, 18 Sep 2022 00:16:00 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-at01.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1oZfAO-00GP6r-HF for ffmpeg-devel@ffmpeg.org; Sat, 17 Sep 2022 23:16:00 +0200 Received: from ren-mail-psmtp-mg01. ([80.109.253.241]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id Zf9moPPmk8s8UZfAOoEt8O; Sat, 17 Sep 2022 23:16:00 +0200 Received: from localhost ([213.47.68.29]) by ren-mail-psmtp-mg01. with ESMTP id ZfAOoibLROG5ZZfAOom24V; Sat, 17 Sep 2022 23:16:00 +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.4 cv=KJo5sHJo c=1 sm=1 tr=0 ts=63263910 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=NEAV23lmAAAA:8 a=c5QjGmhTwOig4Jn9F5gA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 17 Sep 2022 23:15:57 +0200 Message-Id: <20220917211557.11547-9-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220917211557.11547-1-michael@niedermayer.cc> References: <20220917211557.11547-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfP7EFXbA4RImoSaLqAEXsIfCQQWF1iv1q3/3CzxnAESKXU1qaD7Zz26MjdpyfXW+Q+0ZdaQI6rEcZD3MHrBBCzJigvpKyM9qUgb7cQoSZ6MdB9+C6t31 Q96ZaI1NgZ5SeZN4TiT25daFGVT3ihJA8cBV5GllxyDHmNHYY0QoFsO+EXq7FmsqMAgyBZrF32pumg== Subject: [FFmpeg-devel] [PATCH 9/9] avformat/jacosubdec: Fix overflow in get_shift() 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: BZ1gWQVsPlDc Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-6722544461283328 Fixes: signed integer overflow: 48214448 * 60 cannot be represented in type 'int' Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/jacosubdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c index 0ee4820f62a..61b1316dc9b 100644 --- a/libavformat/jacosubdec.c +++ b/libavformat/jacosubdec.c @@ -144,7 +144,7 @@ static int get_shift(int timeres, const char *buf) ret = 0; switch (n) { case 4: - ret = sign * (((int64_t)a*3600 + b*60 + c) * timeres + d); + ret = sign * (((int64_t)a*3600 + (int64_t)b*60 + c) * timeres + d); break; case 3: ret = sign * (( (int64_t)a*60 + b) * timeres + c);