From patchwork Mon Jul 2 00:10:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 9564 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp3258196jad; Sun, 1 Jul 2018 17:12:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpet2zk/5AfucMKQOEEY/Hl5Cm3AESjcJR3wWLSTgD68LS9CDvpLmFE/70zI7WVUCDZv/goG X-Received: by 2002:a1c:f46:: with SMTP id 67-v6mr4215740wmp.122.1530490321023; Sun, 01 Jul 2018 17:12:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530490321; cv=none; d=google.com; s=arc-20160816; b=UXkcCmMZVo/Oik0r90Wie5L7NPhgVMIIrYMoM3zsjv6ZLUVud2F9KqrkEHkn4wvwUF wPB/uKCoeiMEdu2vu4K7WgQ6bml4agIGdgYZtInjRaC8UWHXbUnWM6C0QOdT/EMyWDtq EwOowkNlHaCDSLBxBLpbtgQulgWQumXhR3hBHOT9fEAFdec2kzphRqyiV5Ya4wqBrScf 4oJJDiu+UL5IodFBQ5+zKFz518xySZ5Fc5BnIUfpApo5jHxxjy4WNt5dLA4B7hufGWFG ZQUQX/IIlmXMTObjBJMiUt54rvn++8wIhKN6TLlQIWdbSXxTxz/Tt8i4Thqp16WeJ+L+ mreA== 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:arc-authentication-results; bh=ZvxFchSv8H8uydQ4bwflZXSmLnCQb/nnRDc4LiA1mIQ=; b=HIIYu44TJuopdZ3x4+jnkSOR/FP0bh1aC/x2RB7s1cHoE88CY1sDXam2+afVkLESb3 vMGAva1UPiTveo6tFNShluRWfMxDNb270uk+MJqCbibXsD1rUTjGC/HjAAxzv0jt98e3 f7JdNK91AGDSUJlrBJlUJ3JuQofreev0vvCvoAWEiHdi0nNHZV8BQdH/PZJvfmfqh/Sp +nvv/cXMv1RxTae7d2MzL+Ba4jI1clNM7I9PUdoMXtl1kZqaFmjYrVAprMzlR9SSTHeE 0RzVn+yzaLGJGI7FjAQK3hncIvP7uzsM/H9v9ORVOpPTp1snr4RN+L+v8fg22C20oGm9 hyTg== 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 v6-v6si4339662wra.377.2018.07.01.17.12.00; Sun, 01 Jul 2018 17:12:00 -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 701106891FC; Mon, 2 Jul 2018 03:11:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-1.mx.upcmail.net (vie01a-dmta-pe04-1.mx.upcmail.net [62.179.121.163]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A93CC6882DA for ; Mon, 2 Jul 2018 03:11:42 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fZmRV-0004EU-7x for ffmpeg-devel@ffmpeg.org; Mon, 02 Jul 2018 02:11:45 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id 5cBb1y00E0S5wYM01cBcdp; Mon, 02 Jul 2018 02:11:36 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 2 Jul 2018 02:10:45 +0200 Message-Id: <20180702001045.29491-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180702001045.29491-1-michael@niedermayer.cc> References: <20180702001045.29491-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/indeo4: Check for end of bitstream in decode_mb_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: Timeout Fixes: 8776/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO4_fuzzer-5361788798369792 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/indeo4.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c index 7dff9db877..15ad6f8afc 100644 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@ -492,6 +492,11 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band, mb->b_mv_x = mb->b_mv_y = 0; + if (get_bits_left(&ctx->gb) < 1) { + av_log(avctx, AV_LOG_ERROR, "Insufficient input for mb info\n"); + return AVERROR_INVALIDDATA; + } + if (get_bits1(&ctx->gb)) { if (ctx->frame_type == IVI4_FRAMETYPE_INTRA) { av_log(avctx, AV_LOG_ERROR, "Empty macroblock in an INTRA picture!\n");