From patchwork Fri Jul 6 15:24:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 9636 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp3138934jad; Fri, 6 Jul 2018 08:25:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd0S3dQEVSSQwHZXWwka6VLPCqKzUcDBrr+o4m88GEwcxusb6ZnI2XtUbR6sTXQyQmX5crm X-Received: by 2002:a5d:494c:: with SMTP id r12-v6mr289895wrs.66.1530890741081; Fri, 06 Jul 2018 08:25:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530890741; cv=none; d=google.com; s=arc-20160816; b=DBnUfkzn/NpSLHJcgiF3V/LO1g/r0xwZ/JxjJJ4RvEQTnnQG8HtzAJ/84p9sBupFrz Wd+PkRB9qR46ml6EnjQH01hFDdscbi84QVL9ICJN2ua1YM+ENPn9J1BKAKjn3DohAXgz QO8eeRMJtoF8J14PwpFqmZ9vXtelHzpRT5Z4Gkr9Bp3GbBs9NpD2MuGXlcB9fsp8xiKf HyWtQIFjQfMNLztlliH84vmXtLbJgUcAemSH8zyaEp8nX8xXTdYPMA30iwsHN3T/5D9m +plg4S5GO57pYuQL6GOm7TrNOKvw4ciCW+cCKXeXsKFM9Tv8rdrMPInWm4Cd62YaTTjm C5gQ== 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=zI1qrKh9rQ5rboEWOXMda9Fy+UtBbyUMTQrQQtSGojk=; b=hPG64eCvHXWm7nQEorOCiG1NrYFx+o/R9YqbsFlo0rdhXSI1/xvSnwpVf3sCtdbIJC D4xBdMpIfQmHKutLFLSAC11ZnCI3B7KK4UeJ2S57ZqMps3RFYlvkRlk+we4+fNmZsYBF WYM6DLjRnzce21MrKfuYpq8XWPmWGrwjM5ELWHZATks9fguK57ozXJAdQxhBIsCIM92v 4GtckJ3sv3z20anpibdUbQgcSRyiiV2kCZjloj57FT3COmCaff0qhC7TeRmWhyN1mg4Q JO4WoqoIDLp1nX8WjmUq684i4FoJWElv0rxKvdgW8O/xlppThY0eWIREyGp9fOny1SC7 t9qA== 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 r16-v6si7430437wrt.462.2018.07.06.08.25.40; Fri, 06 Jul 2018 08:25:41 -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 2D8D568A561; Fri, 6 Jul 2018 18:25:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-1.mx.upcmail.net (vie01a-dmta-pe05-1.mx.upcmail.net [84.116.36.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0138068A50D for ; Fri, 6 Jul 2018 18:25:26 +0300 (EEST) 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 1fbSbz-0005z8-UV for ffmpeg-devel@ffmpeg.org; Fri, 06 Jul 2018 17:25:31 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id 7TRR1y02V0S5wYM01TRS25; Fri, 06 Jul 2018 17:25:26 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 6 Jul 2018 17:24:30 +0200 Message-Id: <20180706152430.29695-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180706152430.29695-1-michael@niedermayer.cc> References: <20180706152430.29695-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/mjpegdec: Check for odd progressive RGB 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 access Fixes: 9225/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEGLS_fuzzer-5684770334834688 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/mjpegdec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 00cfdd7151..5e784d980c 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -626,6 +626,10 @@ unk_pixfmt: avpriv_report_missing_feature(s->avctx, "Lowres for weird subsampling"); return AVERROR_PATCHWELCOME; } + if ((AV_RB32(s->upscale_h) || AV_RB32(s->upscale_v)) && s->progressive && s->avctx->pix_fmt == AV_PIX_FMT_GBRP) { + avpriv_report_missing_feature(s->avctx, "progressive for weird subsampling"); + return AVERROR_PATCHWELCOME; + } if (s->ls) { memset(s->upscale_h, 0, sizeof(s->upscale_h)); memset(s->upscale_v, 0, sizeof(s->upscale_v));