From patchwork Sat May 5 20:47:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 8797 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp1379121jad; Sat, 5 May 2018 13:49:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpYAeIvCTtkm7NsyCoc20crL2iBHdCq8JiFCWuJUXS5EQrmFyBrEacer7f0QO6Zq2MpHvF5 X-Received: by 2002:adf:e943:: with SMTP id m3-v6mr23458390wrn.185.1525553354429; Sat, 05 May 2018 13:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525553354; cv=none; d=google.com; s=arc-20160816; b=r86DO9fL2+TNy01p7OHvT3Z0kuEfhcFroeNvI6mBi7plN+XyqTzOS1bR+2+SrNn3iT TqmW3mFeey5J9cDZsCYjb6qyyQPMXBGdlJD8AAS9F5SHc2qNOfhL6zGtm0kHL0qi3Bkj ibq8fYArSahXgfiHr+vPA9wXvt/dWnJxZUAc2Jq29RMOkpKwVoduBijkWiPwvi2xhPNe YGCeLv7cOJcMS7kT94G2UsChuWYY4sYw54JB2kPrZnDImQcytDArktEnrKk2WxoyTTEY 4oQIKxYmt3AHBm3xcck0nY6xMBZixBGTlnYw/2quSnJcaRqi03z7HIKftcyUdiplIlv0 Pmrg== 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:message-id:date:to:from:delivered-to :arc-authentication-results; bh=wciEhe3whRsA+hz1gE+lYmnxkgs6t7PLTSG+/HktTfg=; b=oo5ofeEi1TREDp4XAzwyyQr2Jc5CtYDC5uNoLpBhDMQiTA06b3PubM9pICNdLFhlnm r8WVlguhnJN5ndk3SDV0hbzNPzx7Q59PHqH2yKkWN2TZMNMK5dfB5GBF9sgdbkD1gAZh c0Hn23Sc4kczwxLPHBvRQpw3y4YNDq3UQe4G05bgGAooGMwE9bTpv0u6whEV+rh6FmV7 5A4FBoFmOhoM9phRJi4qRgtnK6BwCcagualL8bCQhE2NWYlslerf6lzRtdLtYXmlNfl3 fGBsAHiRiVH5DtM4h39GyfysI4aMBFpJz9DHSvrzp2mJURPMFUw5B2bHuFueUT7rEKgk koVQ== 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 j29-v6si3311014wmi.219.2018.05.05.13.49.14; Sat, 05 May 2018 13:49:14 -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 6CF6D68A5BD; Sat, 5 May 2018 23:48:38 +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 E2D3C68A568 for ; Sat, 5 May 2018 23:48:31 +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 1fF477-0008CB-Lb for ffmpeg-devel@ffmpeg.org; Sat, 05 May 2018 22:49:05 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id ikov1x00S0S5wYM01kowJQ; Sat, 05 May 2018 22:48:56 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 5 May 2018 22:47:37 +0200 Message-Id: <20180505204737.3717-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.0 Subject: [FFmpeg-devel] [PATCH] avcodec/fic: Check available input space for cursor 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: out of array read Fixes: 6546/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-6317064647081984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/fic.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/fic.c b/libavcodec/fic.c index d7ee370423..6824a5683c 100644 --- a/libavcodec/fic.c +++ b/libavcodec/fic.c @@ -337,6 +337,11 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data, skip_cursor = 1; } + if (!skip_cursor && avpkt->size < 59 + 32 * 32 * 4) { + av_log(avctx, AV_LOG_WARNING, "Input is cursorless\n"); + skip_cursor = 1; + } + /* Slice height for all but the last slice. */ ctx->slice_h = 16 * (ctx->aligned_height >> 4) / nslices; if (ctx->slice_h % 16)