From patchwork Wed Oct 21 22:37:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 23137 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 57EA044B350 for ; Thu, 22 Oct 2020 01:38:44 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3EBD468B327; Thu, 22 Oct 2020 01:38:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe01-1.mx.upcmail.net (vie01a-dmta-pe01-1.mx.upcmail.net [62.179.121.154]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 51C4B68AAFD for ; Thu, 22 Oct 2020 01:38:35 +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 1kVMkd-0000Kw-0J for ffmpeg-devel@ffmpeg.org; Thu, 22 Oct 2020 00:38:35 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id VMjfkGJpeIr7GVMjfk5WMt; Thu, 22 Oct 2020 00:37:35 +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=QN4WuTDL 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=ZAg8fOCVN6v4czngG_UA:9 a=wf1koRQNp8EEvPAN:21 a=BtFIeTYhKP9e_ZeQ:21 a=1fhp2MxaeJtTNGEnv6mo:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=UDnyf2zBuKT2w-IlGP_r:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 22 Oct 2020 00:37:29 +0200 Message-Id: <20201021223733.2563-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201021223733.2563-1-michael@niedermayer.cc> References: <20201021223733.2563-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfJPjhi0qO83qSiyR3ErhVyOl6QGeaXsmtjgIo2TGXWqAkmv3eNlyfjfVhsEZ5F6wmDhR6IDj6LCH8gO1jo7HlKRSps8nTfd2Nr6/KQgXl67ZzbmVkazX uGBJwndbz5ZFfTr8LY9LX12eCx+R2OWgVbasK535vy6iXwC1/yc861l1 Subject: [FFmpeg-devel] [PATCH 5/9] avformat/vividas use avpriv_set_pts_info() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" Fixes: assertion failure Fixes: 26482/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-4905102324006912 Fixes: 26491/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-6002953141616640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/vividas.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavformat/vividas.c b/libavformat/vividas.c index 4b2801ef34..999c4a5d1c 100644 --- a/libavformat/vividas.c +++ b/libavformat/vividas.c @@ -319,6 +319,8 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t * for (i = 0; i < num_video; i++) { AVStream *st = avformat_new_stream(s, NULL); + int num, den; + if (!st) return AVERROR(ENOMEM); @@ -331,8 +333,9 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t * off += ffio_read_varlen(pb); avio_r8(pb); // '3' avio_r8(pb); // val_7 - st->time_base.num = avio_rl32(pb); // frame_time - st->time_base.den = avio_rl32(pb); // time_base + num = avio_rl32(pb); // frame_time + den = avio_rl32(pb); // time_base + avpriv_set_pts_info(st, 64, num, den); st->nb_frames = avio_rl32(pb); // n frames st->codecpar->width = avio_rl16(pb); // width st->codecpar->height = avio_rl16(pb); // height