From patchwork Wed Nov 22 20:00:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 6281 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp599549jah; Wed, 22 Nov 2017 12:01:13 -0800 (PST) X-Google-Smtp-Source: AGs4zMZbdIfyKUQJGNpbprkLlUOjFbOdlT0GrWUxJQoeN7mAlGHLoq8cXy1vhGWiBc/WvHsi0zcM X-Received: by 10.28.169.198 with SMTP id s189mr4779739wme.65.1511380873278; Wed, 22 Nov 2017 12:01:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511380873; cv=none; d=google.com; s=arc-20160816; b=BCqjAS8s9jUoRl8ASCn/zc6FJMxTPZIEBqCMX9waB7usA0egQBbTW+z2eLxBkCRBWq qt1jWjOOngSMgkCUhpwxlKxuSMMuJpnqHPBr3mIuNDIhYqDqITiXzRbSxIiTgh7Nasxr 3FmQP9vAocn9se6YdVLE6Bp21EuOCK6bNuxh9X3cpfpHqFpeuzvQX0YH2oiEo5axjNWT N4GCySFWb3iTuTHU0Qec8bw+EZGC1in5iRfRGUdsYnI/1USL/pWTC+KqpIWCcWTDS06M 6GqXP4ThPqOJg7UMNhWDP/EcAzIt9qYy84srKYYhsShi/oRjqOov2O2GviwlBEwuhJB7 jwYw== 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=hpcuUoShgFFpq3YYZVmZFh8BIAYOVkIq+DVThoeloZg=; b=eyjit9a8femtf+6abyVmtwh9Pe9o4ei//bMRZSIpbhGfxcMABTqftdmsZd3mjjmswd 5l6OVVRwDATaTNDKZw9xdM8I0uwZnqvToOHmMn1elQXBoo/naDn92UnAATyS/M1Iw54h Z1ajyROKC1Y37zbL9Meca1Zs/jO3euMLy+291rLhEuc7lzBTP2B6XOyPuUhnqYBk2snK PGAdj01xrYLEqsLeIL9iJSEcvaw1j0kB6g2lhKMu64JgxOESNMS4A/d6GZBCdv3ci0Nq gPaddOGn7eUlugU4P/ShkPA9NzVVyNrJ9X1bFZf6Ub4/6lrzpr9VllHRNcyXEcoeW5un dHNQ== 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 w5si13464691wrg.366.2017.11.22.12.01.11; Wed, 22 Nov 2017 12:01:13 -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 4AB21689FD6; Wed, 22 Nov 2017 22:01:10 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe03-3.mx.upcmail.net (vie01a-dmta-pe03-3.mx.upcmail.net [62.179.121.162]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CA3DB689DD3 for ; Wed, 22 Nov 2017 22:01:03 +0200 (EET) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1eHbCh-0003Vh-FB for ffmpeg-devel@ffmpeg.org; Wed, 22 Nov 2017 21:01:03 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id d8101w00o0S5wYM01811yx; Wed, 22 Nov 2017 21:01:01 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 22 Nov 2017 21:00:58 +0100 Message-Id: <20171122200058.2843-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171122200058.2843-1-michael@niedermayer.cc> References: <20171122200058.2843-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/sbrdsp_fixed: Fix integer overflow 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: signed integer overflow: 2147483598 + 64 cannot be represented in type 'int' Fixes: 4337/clusterfuzz-testcase-minimized-6192658616680448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/sbrdsp_fixed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/sbrdsp_fixed.c b/libavcodec/sbrdsp_fixed.c index a0ef6859f1..0db932a105 100644 --- a/libavcodec/sbrdsp_fixed.c +++ b/libavcodec/sbrdsp_fixed.c @@ -133,7 +133,7 @@ static av_always_inline SoftFloat autocorr_calc(int64_t accu) round = 1U << (nz-1); mant = (int)((accu + round) >> nz); - mant = (mant + 0x40)>>7; + mant = (mant + 0x40ll)>>7; mant *= 64; expo = nz + 15; return av_int2sf(mant, 30 - expo);