From patchwork Sat Feb 17 03:20:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 7620 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.150.1 with SMTP id c1csp1432301jai; Fri, 16 Feb 2018 19:21:23 -0800 (PST) X-Google-Smtp-Source: AH8x225+hC2MDw2rWvxH3n1f0fu39dLzkwSIqZ7oLhorQm7+nsq8q73nX67u2S7dBhohO3clQmxA X-Received: by 10.28.22.145 with SMTP id 139mr6124615wmw.56.1518837683280; Fri, 16 Feb 2018 19:21:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518837683; cv=none; d=google.com; s=arc-20160816; b=clXkrQmGH0Sbc+8BjxfkVEDqRqp7KlopcAjrm6X+kTGLDefoo7+Ll8SV4bIJ+SMEZE fWljCrLowi0GcfduQV2CqjA5lErnmZP1J663Tzw4m2tuDQcpjYfHHJiCjfbkSpsdpjDG F/pryRaFHAvoT7HyMbz/Wkixl58i8Eofaj/GuX8ua0I9ekCT6csu1kqveN17eCxouAvy C0Vyqn2zMS4bziuUvjJOBdRecYQ+SZ9m1J+ENW18h1BT2HaRtVpFrNuzBdFi0lTiKiCw rPyIXU0MKxLw5i+a4N0u83Sg0gdnEhXa4JsIf9eY96syuBJ8cRZnYOyGf4uSrYus30ss 2Ggw== 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=NiVNcnjUp4MbrPYj0c4vGgaoktwshLurMoYoRdydKjU=; b=IVXxNt7jMMQJlOwvIDlQRmI6JhyUJHBGproViKf9irsgECdXb3t4bMETIEt64QUU/N 9qxWymo7iHmwUE4DnSHLNt3WVJIkRsxcK8n+kV3Yld6+zZEKjIUJRJq66RXCnC7Fb+sO X5FYMRUsKLGiCAumZzewVo1LV7ymduN9AKLgJdzz0vsfzs5U+wN2QWQgrNokT0/ZOM53 kBm+Wan9MXYXB5xzfAJTEIMpULZoujdOwgC+krYqHraPcU9h6/nXhqUANbxOd8de730Q dwxEvsDAPCmFctoO2Is7Ej9+VI80cp9F2SbynJ58virX/K41e402PlCsym+UGRJS/Mij 72+Q== 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 u16si11063510wmd.249.2018.02.16.19.21.22; Fri, 16 Feb 2018 19:21:23 -0800 (PST) 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 626DC68A1FC; Sat, 17 Feb 2018 05:21:01 +0200 (EET) 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 C872468A19E for ; Sat, 17 Feb 2018 05:20:53 +0200 (EET) Received: from [172.31.218.36] (helo=vie01a-dmta-pe02-3.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1emt3i-0002Rl-09 for ffmpeg-devel@ffmpeg.org; Sat, 17 Feb 2018 04:21:06 +0100 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1emt3c-00038C-2t for ffmpeg-devel@ffmpeg.org; Sat, 17 Feb 2018 04:21:00 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id BfLv1x01H0S5wYM01fLw3j; Sat, 17 Feb 2018 04:20:57 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 17 Feb 2018 04:20:53 +0100 Message-Id: <20180217032054.21778-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180217032054.21778-1-michael@niedermayer.cc> References: <20180217032054.21778-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/3] avcodec/jpeg2000dec: Use av_image_check_size2() 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: OOM Fixes: 5733/clusterfuzz-testcase-minimized-4906757966004224 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/jpeg2000dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 4cf8a2880c..5414ce5655 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -285,7 +285,7 @@ static int get_siz(Jpeg2000DecoderContext *s) avpriv_request_sample(s->avctx, "Support for image offsets"); return AVERROR_PATCHWELCOME; } - if (av_image_check_size(s->width, s->height, 0, s->avctx)) { + if (av_image_check_size2(s->width, s->height, s->avctx->max_pixels, AV_PIX_FMT_NONE, 0, s->avctx)) { avpriv_request_sample(s->avctx, "Large Dimensions"); return AVERROR_PATCHWELCOME; }