From patchwork Fri May 4 17:43:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 8781 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp284275jad; Fri, 4 May 2018 10:45:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqNjKDvS7LSD22o8Ww2yj/uTRNj1MgdmLij1nC5ZzPkmdmnU+aw+Yoz3iLU1FXdYzRn0nAn X-Received: by 10.28.98.65 with SMTP id w62mr13876118wmb.115.1525455943067; Fri, 04 May 2018 10:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525455943; cv=none; d=google.com; s=arc-20160816; b=AwUPWu8Xn79r6ZYc7Ybw7/l53pCI1ZstDbuj4odSutYlKKcF1PPnUPjg4My4dSKLzT jrdUGpRmUesxFKLtP/i0QmaJujlt7D1MuQ9QScetLJCsLQF03BLm1R6NPBjrSkH8ZLXC eqEOx6jV7bjlKE0GaCKvXHlvvEri431wZPSp4CU+mZSAfjmnPm7JD5I2ji+wJ6HGQpd6 IG5uE7ijds3kOLzT1ruaEykRWMrMNsL8K/umIKz+0PNhg4WwSpKg/HY4Nrge1HkPvHK1 vwNAfVQtxo9Yc3vsbT9jR9KxPUcxQWOghQp2+q2Q19hlWhSi+1+FwkRLMYV1isi2aSoF snyA== 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=zxhn1hSF47wVNH4HpS7T3nBHXNNM+33LYRXROw7tyQg=; b=L+8pBa6IrgGYdLy/1mjhVscgK4cq7YXy+CWbLyzy1zGBJmbX3tkATCK9Rtca5vUKRc ydGw3R/yrh4yJtS1Pbq3v/Ps+PcDYlhRo9StfLVzeulDHoBJ/BopiOWqu/TLhAkboOdH AP5+YYBcQgQjKph2/uCSUA0tAy2VbnOojVLrz0x861/YT0rS4mSR5apNjRvw+EeKbWiG Zlb0Ob2B1rgDsArk1yAESfzohJWQ5G6TQ+99AsQqFdHDzRovD9RG3kwkFVjVXRcMGCRl dof9+WdoUSf87l6PPLZJwmXId90o8e32XYHBWIsYE+MDOs3g/pesamdCct2P5/V6P6ga Gfgg== 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 b26-v6si10585574wrc.171.2018.05.04.10.45.42; Fri, 04 May 2018 10:45:43 -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 5994768A5DF; Fri, 4 May 2018 20:44:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe07-1.mx.upcmail.net (vie01a-dmta-pe07-1.mx.upcmail.net [84.116.36.17]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7547F68A5D3 for ; Fri, 4 May 2018 20:44:40 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fEeld-0005fE-S3 for ffmpeg-devel@ffmpeg.org; Fri, 04 May 2018 19:45:13 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id iHl71x0220S5wYM01Hl8qX; Fri, 04 May 2018 19:45:08 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 4 May 2018 19:43:48 +0200 Message-Id: <20180504174348.24364-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180504174348.24364-1-michael@niedermayer.cc> References: <20180504174348.24364-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 4/4] avcodec/jpeg2000dec: Fix undefined shift in the jpeg2000_decode_packets_po_iteration() CPRL case 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: shift exponent 47 is too large for 32-bit type 'int' Fixes: 7955/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-6016721977606144 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/jpeg2000dec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 5aa0713ed6..12dcc5c6f5 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -1181,10 +1181,10 @@ static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2 int xc = x / s->cdx[compno]; int yc = y / s->cdy[compno]; - if (yc % (1 << (rlevel->log2_prec_height + reducedresno)) && y != tile->coord[1][0]) //FIXME this is a subset of the check + if (yc % (1LL << (rlevel->log2_prec_height + reducedresno)) && y != tile->coord[1][0]) //FIXME this is a subset of the check continue; - if (xc % (1 << (rlevel->log2_prec_width + reducedresno)) && x != tile->coord[0][0]) //FIXME this is a subset of the check + if (xc % (1LL << (rlevel->log2_prec_width + reducedresno)) && x != tile->coord[0][0]) //FIXME this is a subset of the check continue; // check if a precinct exists