From patchwork Wed Sep 12 01:08:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 10297 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp4272559jap; Tue, 11 Sep 2018 18:09:15 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda5k+ryZjJF/lMtoMehP0AcBMIU3ZWWsjGiTXqY2Zc2DLXkyJbq/T5aK1tR0iu9ZdJ9EH2l X-Received: by 2002:a05:6000:1291:: with SMTP id f17mr15807752wrx.215.1536714555272; Tue, 11 Sep 2018 18:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536714555; cv=none; d=google.com; s=arc-20160816; b=erTeEUS4K1RYFy/BdoOOXK42fz5dfBoAzXWhAXgMbgAAQa52+PEyCXBuBBjP6NQ7Ij GnOpf5EsD4eUA7cwjarxvQnzgc06HnUsWWolSzp0K1Y3cHO9X+pCo01K0w0jIYgl6xUQ n9z9Bwy8MgxqzfD/h+KIVecL7lPfYU+gwLpCJVrr66fC33moqcr+YbXYgJ+oiBpeziFN pj4XbNg4elrK3u7nUbYQGAMxu5GVuW7WPo2yuv5jLpwWlX+lDRfUIvkGhHHL2pCbXcqb 7HJrTUC0F2Y7Xo4fRoMhH2kpbUi2206t+shTZhvBM+A7KHqj9YQrJozU74NBFObGttHX wffQ== 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; bh=5W8m+F8vTeq8jDuODPRoCx70SBxY3i0fuh3D8HZHjY0=; b=Bg1u72jhsSmE3K1byO8C3q5u9RcjucgcCZXHRO8TjxwVu0EjgdRZUB6wXuyytJBHcM vXcmfZx71hHVBH9EAYFOubikgH0HCWYIGlMYXq3mpd0hYoWt3tLEgjbW+/5c1GSweXcf 0OKQI1iOpnL3/+/Bkyy7lbdh7/cSyk+LyQuBy7aZHA/ceD7mLNlHTUOETQBxU71EDdAI 8vIftEZ1/664GPcA2AgmGou0lehL6sJ9HymaXF6Zt/jZGPTvxu1p/woz/yCOIroI0XQt mQ/tGRUoHd5sc95I97YxTvNq4axI5BygbniE/3FymKdmwwDzdlP+gf4H9CCp99urZuCP w6yA== 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 j8-v6si19549283wrp.323.2018.09.11.18.09.15; Tue, 11 Sep 2018 18:09:15 -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 46BD168A508; Wed, 12 Sep 2018 04:08:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-3.mx.upcmail.net (vie01a-qmta-pe02-3.mx.upcmail.net [62.179.121.183]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5430368A4F6 for ; Wed, 12 Sep 2018 04:08:47 +0300 (EEST) Received: from [172.31.218.43] (helo=vie01a-dmta-pe05-1.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fzteL-0004mC-2p for ffmpeg-devel@ffmpeg.org; Wed, 12 Sep 2018 03:08:57 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe05.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fzteF-0005bb-RK for ffmpeg-devel@ffmpeg.org; Wed, 12 Sep 2018 03:08:51 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id aR8k1y00k0S5wYM01R8lLE; Wed, 12 Sep 2018 03:08:45 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 12 Sep 2018 03:08:08 +0200 Message-Id: <20180912010808.31637-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180912010808.31637-1-michael@niedermayer.cc> References: <20180912010808.31637-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/pictordec: Error out if more than one plane is unused 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: 9797/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PICTOR_fuzzer-5664441659031552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/pictordec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c index b29a484534..65d2d49060 100644 --- a/libavcodec/pictordec.c +++ b/libavcodec/pictordec.c @@ -236,6 +236,9 @@ static int decode_frame(AVCodecContext *avctx, } } + if (s->nb_planes - plane > 1) + return AVERROR_INVALIDDATA; + if (plane < s->nb_planes && x < avctx->width) { int run = (y + 1) * avctx->width - x; if (bits_per_plane == 8)