From patchwork Wed Jun 12 13:23:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 13515 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 1463D449025 for ; Wed, 12 Jun 2019 16:31:27 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DEF90680C46; Wed, 12 Jun 2019 16:31:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe07-3.mx.upcmail.net (vie01a-dmta-pe07-3.mx.upcmail.net [84.116.36.19]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E77286806DC for ; Wed, 12 Jun 2019 16:31:19 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1hb3Fs-0005X0-2M for ffmpeg-devel@ffmpeg.org; Wed, 12 Jun 2019 15:25:32 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id b3EthGlWf5D5Nb3EthDfJg; Wed, 12 Jun 2019 15:24:32 +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=w4PaEGB2TP0r070mPycA:9 a=VlZU0XKO32wA:10 a=1fhp2MxaeJtTNGEnv6mo:22 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 12 Jun 2019 15:23:59 +0200 Message-Id: <20190612132359.30067-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-CMAE-Envelope: MS4wfD2BYNS1ZhE+Q0WWLWV+be8GvcF9RWcEKqSkutvf0UHseoWkaTRJY0Kpk8WZoyKtolegUqy7YlNbd9pGvbXugsGYsuCRE0obwA4qKAMPmZXlpPC/dB3U R5CnDOHWU17zTRiMmGuU3tZyUnQtU55vOvdl1FkQv3irLC3qjbaspEqW Subject: [FFmpeg-devel] [PATCH] avformat/vividas: check length in read_vblock() 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: out of array access Fixes: 15166/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5731062396747776 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/vividas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/vividas.c b/libavformat/vividas.c index c99cbd1f6e..ec20aabbae 100644 --- a/libavformat/vividas.c +++ b/libavformat/vividas.c @@ -205,7 +205,7 @@ static uint8_t *read_vblock(AVIOContext *src, uint32_t *size, decode_block(tmp, tmp, 4, key, k2, align); n = get_v(tmp); - if (!n) + if (n < 4) return NULL; buf = av_malloc(n);