From patchwork Sun Sep 18 17:14:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 38015 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp791193pzh; Sun, 18 Sep 2022 10:15:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4RrqTlXeumq8N+jufjf8Iivhfmw5BgiynCgd3kvOgjDIii4lhZnNA3gCr/lu7hs08ci0AG X-Received: by 2002:a05:6402:b6c:b0:44e:2faf:1ba4 with SMTP id cb12-20020a0564020b6c00b0044e2faf1ba4mr12305739edb.191.1663521339512; Sun, 18 Sep 2022 10:15:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663521339; cv=none; d=google.com; s=arc-20160816; b=MlD/uZX0LuAx+s+w8ILCDz38eWD51M8efUbNYpTp+Ki1jBoARKK/0WR5CauAo25hOZ qHhdraoAA3NF5AjIXgmHHY0W42N8Dv/OIhvE2sESGr28WyIzd6dFtQGErFOICzIjQlAY VFID/YiwkqrBhnd5073VQ3LQWy1Fr3cCaMWZkNTxbX9aGtVXKfpfXG4my1CgWf3G/kd6 iQ9hDHCwVBYJtYFFkDT5WpnXxw1YA2bQNvmHsZv2FQkBLzyw+s4mrdi48MmNQn1UH37i yogj0JXJqqIP5S2Cn4+nzWyU/PvAQlySs5Mu13FSNST3QR2bHV+hS+zidlthXoJI7Kak Ge+w== 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=1lAZIrsPQFjyRyFt27sRa5HZGWAjUSIu4MPV5Jemqxw=; b=rxB94nuoi098dT7JpozpxmeDUK7HDyONyH+x8XgflWZowI1xygyWwZvL6YTucpH+++ x+UbpT0Y+E4gZavhQ5PzhPidbgm59jAl11EgMHRwWSG9dd3crlaFMZgpbChKhjPunPE2 LHYqzev5PXZT6m973oAat76FrqKPDTA5kGzMbM5ALLPJy3BI3FE5KijxU8+C+NJD8+ej g4AhjlJIqpW4jju27LHiD/NeDcbZ37PEKUzdgJ+LU5AayIuilGLOBysbEsWhfGmDdeWC DiPhpb2oyJCgcKqAShZuq+iVaJXY6DM2Xjhdxf2TkIT9SkrU2ZGNCNXjip9iT6L4mXyH tkjQ== 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 t19-20020a056402525300b00451fabfd89csi8468929edd.552.2022.09.18.10.15.39; Sun, 18 Sep 2022 10:15:39 -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 0D53C68BBCA; Sun, 18 Sep 2022 20:14:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-at02-1.mx.upcmail.net (vie01a-dmta-at02-1.mx.upcmail.net [62.179.121.148]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C189F68BAB9 for ; Sun, 18 Sep 2022 20:14:13 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-at02.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1oZxrx-0047Wn-Am for ffmpeg-devel@ffmpeg.org; Sun, 18 Sep 2022 19:14:13 +0200 Received: from ren-mail-psmtp-mg01. ([80.109.253.241]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id Zxrtolzzr8s8UZxrxoH67E; Sun, 18 Sep 2022 19:14:13 +0200 Received: from localhost ([213.47.68.29]) by ren-mail-psmtp-mg01. with ESMTP id ZxrxoprDfOG5ZZxrxonHii; Sun, 18 Sep 2022 19:14:13 +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=632751e5 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=NEAV23lmAAAA:8 a=tDVPisFFTa73rHJEf_oA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 18 Sep 2022 19:14:08 +0200 Message-Id: <20220918171410.31835-11-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220918171410.31835-1-michael@niedermayer.cc> References: <20220918171410.31835-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfDbd5uOikFynSxtcRSdV7B3YQPfN2yNcUeVdyOi4L3ghNI+dmAB/widXj3Yt8dy6gVCIJOfoL2QXr2T8rMztHUDDxKZvjB6j6Rpq9ZA5v9kzp1ia7DSg Wapp+4xdzDUAurop/nMq9tLLeCRI4Kx8GVkrVJPIElWgQuuy+GSfsI+B53cnSgDriDwmBX9qBzW1bg== Subject: [FFmpeg-devel] [PATCH 11/13] avformat/spdifdec: Use 64bit to compute bit rate 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: k0tlM3li8udN Fixes: signed integer overflow: 32 * 553590816 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-6564974517944320 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/spdifdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/spdifdec.c b/libavformat/spdifdec.c index 2af75ca9dbd..672133581a8 100644 --- a/libavformat/spdifdec.c +++ b/libavformat/spdifdec.c @@ -226,7 +226,7 @@ int ff_spdif_read_packet(AVFormatContext *s, AVPacket *pkt) if (!s->bit_rate && s->streams[0]->codecpar->sample_rate) /* stream bitrate matches 16-bit stereo PCM bitrate for currently supported codecs */ - s->bit_rate = 2 * 16 * s->streams[0]->codecpar->sample_rate; + s->bit_rate = 2 * 16LL * s->streams[0]->codecpar->sample_rate; return 0; }