From patchwork Fri Jun 9 16:47:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 3890 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.195 with SMTP id 186csp73616vsk; Fri, 9 Jun 2017 09:48:09 -0700 (PDT) X-Received: by 10.28.101.213 with SMTP id z204mr481079wmb.106.1497026889914; Fri, 09 Jun 2017 09:48:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497026889; cv=none; d=google.com; s=arc-20160816; b=0Vi+NJilr+Mwar4BQ8BJ0jh5rnFLuskygjBa1ms5vShtcmV2nkpA0JgzG8H3HA/jVC J6XNKQRrt+CbJ+o97yeuQd+gaAHhD0IMIXznHKkM3v+P/d3UN17kiPqOezuVz45FUtWS o3NzFxcohfUhqcg2/MXgSzYkJ//qr23gAPrlX24s+v3OX8xryhRr2mTmkJSFL70BKD+n +9vfziPxQdOwWDgh6CIhye3cej0faz2fNPV2z9nazrRpjtkbo5bi2gyK6yJJ0Dflv3j5 cpaCgILsGIMCdOtfyC96pB9m/FTlZHynIcUpTBnEcP6+AEQBJ1Gk5Kj7y8WsVPo0jVEE 6Vyg== 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=niebo+mkcr15XkEsJzUFa688ZFVheRodPeaVXO2TN0I=; b=oNDEWD8Q4m9ITDB2sOEzHgnUCrnYut9KvsmLcwKTRTWgb+M7rAh51kruwy/SEAHMUT 8ev+8JEg59OJxHmuQMObQVTCgo6PE98aYx6a4j/mXiP5qGhQp+oyivd/dk0jOx4M3hlE MiAQJN2tEoJLeSOYWGFUvagg4DKZpN1grYW6zeo91jGO9g3F81XBhz/EA2fxpTep4qBm DkorrZUaYoLpX4BhvkFs4tbCrj/wxMA3Cc/zLnXUgALOiUgn96Hdo8Y4MOy2JBZAsZuD eCpfBGmoAhzrSn1HCWdvj1/iVgBNHKJCzCDTaqqYtRt+F2t0QvGHvb9CKw8lZCsBXsMz YPiw== 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 f46si1720643wra.124.2017.06.09.09.48.09; Fri, 09 Jun 2017 09:48:09 -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 DF637689EDE; Fri, 9 Jun 2017 19:48:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-2.mx.upcmail.net (vie01a-dmta-pe04-2.mx.upcmail.net [62.179.121.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D7D50689D72 for ; Fri, 9 Jun 2017 19:47:59 +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 1dJN4p-0001Sg-Us for ffmpeg-devel@ffmpeg.org; Fri, 09 Jun 2017 18:47:59 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id Wgns1v02R0S5wYM01gntRu; Fri, 09 Jun 2017 18:47:53 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 9 Jun 2017 18:47:52 +0200 Message-Id: <20170609164752.22510-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 Subject: [FFmpeg-devel] [PATCH] avcodec/wavpack: Change wp_log2() to unsigned 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: signed integer overflow: 2143315325 + 4186162 cannot be represented in type 'int' Fixes: 2134/clusterfuzz-testcase-minimized-4619258405322752 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/wavpack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/wavpack.h b/libavcodec/wavpack.h index c949390f51..c670b1c1d9 100644 --- a/libavcodec/wavpack.h +++ b/libavcodec/wavpack.h @@ -177,7 +177,7 @@ static av_always_inline int wp_exp2(int16_t val) return neg ? -res : res; } -static av_always_inline int wp_log2(int32_t val) +static av_always_inline int wp_log2(uint32_t val) { int bits;