From patchwork Fri Aug 18 14:42:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4741 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.46.211 with SMTP id u202csp849716vsu; Fri, 18 Aug 2017 07:43:21 -0700 (PDT) X-Received: by 10.223.132.2 with SMTP id 2mr6578048wrf.69.1503067401545; Fri, 18 Aug 2017 07:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503067401; cv=none; d=google.com; s=arc-20160816; b=Tlaiq3rYf4U2WiI/5S05j3QMcnIokl/ifPb3GE8wwkGo4ywT8Mrg4cyGgLIIocQDcQ gF6Qrkv7WbgJS8zLAwgShdLCAi2Nh2GhNgxi7hO93nqLYLiGf3N4K5vvbUf0kESQZN9g oQ/qYWJojAtw77QDyBE0SG1RAtpSibxcyvL02vsNkiPFYywo8hPW+Fdqv8eYx3baMcv/ 3oS9P0y7z2obk0Y/jf9X5A3fPdHHcbcSDrOSwtISHFsLGE4F2YRpgId0/OddeHhbIZWO fiT/kqPdF90ggxLHb3WnSAQzZuu4Ve8kbK7mnuntU3OwrAAT4/gxAO2w2sL3FOFmm8Db sTmw== 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=3LoPRzJhY+Df0YAFSqqNtCYdm2yjcmAMST1VTeH90rk=; b=txUg/bQs0MSHwgWapncHCoW5MjA4uSfqeMboSR1W8168klnCjuzk77qoeDpPpSRjaT 9nqozgmY8IFmtjgggO4UXQ+vwf3zUtmRnzGS5hwj66lnqzsDzWH2uLlDZE6Wz3Hnml9/ Cl9ziyNa4otxBDfgkxYr+sxt0oirQZR5y9/GVwJEbybZu0Uj5OsKMbErR7daIsROlq6G 7qbrLRo4hFhR90xKUaEDq6R8YQchi6JUkM/LVUrF2EoYrKN37R5/Q5ulOMx4TTtxD3yC COL1YcdrWxCbZOO2I3u29OvNX8956VARzZ27S91lh6MPvOsum0/aWePHAOcbAbHGgQTn 7N1Q== 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 x185si1330453wme.130.2017.08.18.07.43.17; Fri, 18 Aug 2017 07:43:21 -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 D6CD068989A; Fri, 18 Aug 2017 17:43:08 +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 CC1186882E8 for ; Fri, 18 Aug 2017 17:43:02 +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 1diiUO-00062J-1p for ffmpeg-devel@ffmpeg.org; Fri, 18 Aug 2017 16:43:08 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id yej01v0420S5wYM01ej1bF; Fri, 18 Aug 2017 16:43:02 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 18 Aug 2017 16:42:59 +0200 Message-Id: <20170818144259.31742-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170818144259.31742-1-michael@niedermayer.cc> References: <20170818144259.31742-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/pixlet: Fixes: undefined shift in av_mod_uintp2() 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: runtime error: shift exponent 4294967289 is too large for 32-bit type 'int' Fixes: 3030/clusterfuzz-testcase-minimized-4649809254285312 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/pixlet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c index 088226bdda..a9cfe085c9 100644 --- a/libavcodec/pixlet.c +++ b/libavcodec/pixlet.c @@ -262,7 +262,7 @@ static int read_high_coeffs(AVCodecContext *avctx, uint8_t *src, int16_t *dst, i flag = 0; - if (state * 4ULL > 0xFF || i >= size) + if ((uint64_t)state > 0xFF / 4 || i >= size) continue; pfx = ((state + 8) >> 5) + (state ? ff_clz(state): 32) - 24;