From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 863B840C4C for ; Sat, 5 Feb 2022 19:59:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CC16F68B000; Sat, 5 Feb 2022 21:59:27 +0200 (EET) Received: from vie01a-dmta-pe02-1.mx.upcmail.net (vie01a-dmta-pe02-1.mx.upcmail.net [62.179.121.157]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 774C468AF82 for ; Sat, 5 Feb 2022 21:59:21 +0200 (EET) 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 1nGR8G-00EpAo-0F for ffmpeg-devel@ffmpeg.org; Sat, 05 Feb 2022 20:54:04 +0100 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id GR7InOkK3SgGFGR7Inx9Tq; Sat, 05 Feb 2022 20:53:04 +0100 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=zQuG7Kw_3Rnl6-iBlckA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 5 Feb 2022 20:53:03 +0100 Message-Id: <20220205195304.14816-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4wfKoAr/Xus1L54teaV+l8fiNcjzvO/vEBFHsPd7+rPYo6IEaqWFrarTwG6sL+EUOV7GOUD58G3Z57uHhWiShSRa2LhZv+pmcn7/0jaYhVJMOTuRy/LUC9 ULo89Y4fNm3L56XYWcTHFoVuSYNNR040MG8O9x+dYKAxYUtY//mqd5J7 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/matroskadec: Check desc_bytes 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Fixes: Division by 0 Fixes: 44035/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-4826721386364928 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/matroskadec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 5a9acfb247..f433391a16 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -4216,6 +4216,8 @@ static int64_t webm_dash_manifest_compute_bandwidth(AVFormatContext *s, int64_t do { int64_t desc_bytes = desc_end.end_offset - desc_beg.start_offset; int64_t desc_ns = desc_end.end_time_ns - desc_beg.start_time_ns; + if (desc_bytes <= 0) + return -1; double desc_sec = desc_ns / nano_seconds_per_second; double calc_bits_per_second = (desc_bytes * 8) / desc_sec; -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".