From patchwork Sat Jul 8 20:51:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4269 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp1759590vsb; Sat, 8 Jul 2017 13:52:23 -0700 (PDT) X-Received: by 10.223.134.16 with SMTP id 16mr3907823wrv.83.1499547143696; Sat, 08 Jul 2017 13:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499547143; cv=none; d=google.com; s=arc-20160816; b=zCD1l6L9QoiOLu8YQrK1ee9vpfohJPRbup8jp4FARezitTki5+qbM7eaS97drH9XOM xg5Cmn8DfVxIEuMNu7VdiDwj4/DwtQDxVKGMNHKKsNGKwxmPj3Z+Qc86FoWlRW1dvspj N37IIT4nv+L5hr8IImi/DMp4ZosdG7Zcvmig0wNwi6144hjBtA8JW/kQ6+kBC2n46Hbz xFmK+yPpQsMLjxKQ89MUHMFq1soAWQG2hyJ1ZM+qjV2lsVYSFPrXS09PZoan/rzS8qiV ONnyy/imLw+uOiLA+NBwLlYYpEuyYEXvqkQaYDBVXplZzeXaOrDlFwEKdpQrDcBrvXOR fLsg== 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:message-id:date:to:from:delivered-to :arc-authentication-results; bh=toGk20LDiLqCbbvb4vaYSSEtXDqgSE+LYTLiS+Z7ARs=; b=yMfx95UhZYy5wIL5no1fU/72AB0E2p75+uQwkuWNa9NmruTy8zeTKnrPXDxt1jZjj8 CqBwJ7riYtxblXwkrXFK4Y+ar4OuBfQ4g7ReQV62CezymzBO27mSqw0kwl1/VODLVdPH h6Ryip0zi8cWvhJqEcZTHIX8nyOfzYEdwZSm63TpGowLoo0wNCTy+zCpQr9o836RKHal CckWSuXesZXstFDTSe573m17IblTt/yXkqBwvQG5jA2Y6Ny8Vzd10is4eyxKPHQQ2Txk BagXeF4MrvcosxIxm+OfR/EjVFEbVSII+yZ3SMEUe6vTKkcoaLDd5QBeAgT2ZK/6zQ5S boXg== 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 e2si2743600wmi.174.2017.07.08.13.52.23; Sat, 08 Jul 2017 13:52:23 -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 A5343689C23; Sat, 8 Jul 2017 23:52:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-1.mx.upcmail.net (vie01a-qmta-pe01-1.mx.upcmail.net [62.179.121.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 38738689AF8 for ; Sat, 8 Jul 2017 23:52:11 +0300 (EEST) Received: from [172.31.218.46] (helo=vie01a-dmta-pe05-1.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dTwi6-0006s1-2c for ffmpeg-devel@ffmpeg.org; Sat, 08 Jul 2017 22:52:14 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dTwi0-0006DY-8H for ffmpeg-devel@ffmpeg.org; Sat, 08 Jul 2017 22:52:08 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id iLry1v0030S5wYM01Lrz4g; Sat, 08 Jul 2017 22:51:59 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 8 Jul 2017 22:51:57 +0200 Message-Id: <20170708205157.11201-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 Subject: [FFmpeg-devel] [PATCH] avcodec/ylc: Fix vlc of 31 bits 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: left shift of 1 by 31 places cannot be represented in type 'int' Fixes: 2515/clusterfuzz-testcase-minimized-6197200012967936 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/ylc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/ylc.c b/libavcodec/ylc.c index bf55e37be1..ae46b3b8c2 100644 --- a/libavcodec/ylc.c +++ b/libavcodec/ylc.c @@ -69,7 +69,7 @@ static void get_tree_codes(uint32_t *bits, int16_t *lens, uint8_t *xlat, s = nodes[node].sym; if (s != -1) { - bits[*pos] = (~pfx) & ((1 << FFMAX(pl, 1)) - 1); + bits[*pos] = (~pfx) & ((1U << FFMAX(pl, 1)) - 1); lens[*pos] = FFMAX(pl, 1); xlat[*pos] = s + (pl == 0); (*pos)++;