From patchwork Wed Jul 17 23:42:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 13980 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 BEB47448541 for ; Thu, 18 Jul 2019 02:49:46 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 47F5668AE71; Thu, 18 Jul 2019 02:49:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe06-2.mx.upcmail.net (vie01a-dmta-pe06-2.mx.upcmail.net [84.116.36.15]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 283B168AE71 for ; Thu, 18 Jul 2019 02:49:39 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1hntaD-0001vT-1C for ffmpeg-devel@ffmpeg.org; Thu, 18 Jul 2019 01:43:37 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id ntZEhCIoo5D5NntZEhBjVx; Thu, 18 Jul 2019 01:42:37 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.41.20 X-CNFS-Analysis: v=2.3 cv=bu8y+3Si c=1 sm=1 tr=0 a=I1eytVlZLDX1BM2VTtTtSw==:117 a=I1eytVlZLDX1BM2VTtTtSw==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=nZOtpAppAAAA:20 a=PE3c63nkz69R6aRbNaMA:9 a=VlZU0XKO32wA:10 a=1fhp2MxaeJtTNGEnv6mo:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=bWyr8ysk75zN3GCy5bjg:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 18 Jul 2019 01:42:23 +0200 Message-Id: <20190717234223.2064-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-CMAE-Envelope: MS4wfDyXuVwkQhgFGlw+ntWAMuLO7t8VxF37zJjGBqfNIdv7ygpyvJLrfnu/w7fQ78tD0VowQ+gIbgKg8qJ2F08lr+mDmIc8C86yTmZzX2JUQmnrRQ//WFWN 9VhQfCALJscdvA6ezjPku38UGQTtVhWWfTUBpmCHn3y5OPIqyzxCkhCT Subject: [FFmpeg-devel] [PATCH] avformat/ifv: Check for EOF in read_index() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes: Timeout Fixes: 15567/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5758451487080448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/ifv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/ifv.c b/libavformat/ifv.c index 6acbb29a75..f95e9b0e52 100644 --- a/libavformat/ifv.c +++ b/libavformat/ifv.c @@ -68,6 +68,8 @@ static int read_index(AVFormatContext *s, } for (i = start_index; i < end_index; i++) { + if (avio_feof(s->pb)) + return AVERROR_EOF; pos = avio_rl32(s->pb); size = avio_rl32(s->pb);