From patchwork Thu Jul 27 21:49:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4477 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp2508389vsb; Thu, 27 Jul 2017 14:49:45 -0700 (PDT) X-Received: by 10.28.43.6 with SMTP id r6mr4311081wmr.78.1501192185181; Thu, 27 Jul 2017 14:49:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501192185; cv=none; d=google.com; s=arc-20160816; b=RZcE6AM5yGHbxlfbRyMBsTihP7PyOkEs0bBZlzwS63XvPUNP0PXngWoSpv/ggPSsVm K3uiPV8wCKMFU/Sh+QzTWxC7B4FEyXFZHbbecGJIAjzDMTRwSzFjoNe9o2NGz6KD++PF LaqBIR1EsZUCsSRHyjPZwmN0wL1GKdM4oxJanSDB0wKPwXI+syu0bnhfkM4/sVkYm4j4 OFcHofxkz7zW3eXCV4xhWat8EEuV7ohfeuxIbv/8JgxyRwzEimApM0WMwb68YEm24bLE NOHhorD5YMo4dv9fEkpPDjpCOPEm8QCLC5K/trsHskhi+OVeYd9OI/4pzIkic8XTwJh2 1Q0A== 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=0bU3/oRKMFfafYdMVAr2YTpOCJIbvsWRRxJDSsU+/FI=; b=LUAGy2nMmUQa3VEdjxh/I1aaYWVKusatqpyYoXvsa1E5WA694CeonnvF9jkQco2eVI OXDHp2+iJ0JV39JDvsAQxZGPPcr/S9qV/HkzWoRYv6zJUAYstuFVlFt0OmWgXpsaH9pL XB1pb9lZh93QGDG59RdM8hA2jkdDw3FWz6serJtfVU3xiewh6QtAPwjFud/LHsLR9v8I tyEEnzEre4dReD73ifczHP1J1XXielewSlH3FYHX8vRfgg6DznpgesTl9ZykdeD2LeBX 9itB9OtTajVdEs4Wb44PSUcYW8rfObtFLx1CCFfras8m1ri64uJJB3i24t3G7hc9mU66 JBmg== 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 w49si15874382wrc.544.2017.07.27.14.49.44; Thu, 27 Jul 2017 14:49:45 -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 DF19A68838A; Fri, 28 Jul 2017 00:49:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-3.mx.upcmail.net (vie01a-qmta-pe02-3.mx.upcmail.net [62.179.121.183]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 948B5680C07 for ; Fri, 28 Jul 2017 00:49:35 +0300 (EEST) Received: from [172.31.218.43] (helo=vie01a-dmta-pe05-1.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1daqf1-0003y5-W6 for ffmpeg-devel@ffmpeg.org; Thu, 27 Jul 2017 23:49:35 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe05.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1daqev-0004pI-Rc for ffmpeg-devel@ffmpeg.org; Thu, 27 Jul 2017 23:49:29 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id pxpT1v00c0S5wYM01xpUat; Thu, 27 Jul 2017 23:49:28 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 27 Jul 2017 23:49:26 +0200 Message-Id: <20170727214927.22553-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/takdec: Fix integer overflow in decode_subframe() 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: -536870912 - 1972191120 cannot be represented in type 'int' Fixes: 2711/clusterfuzz-testcase-minimized-4975142398590976 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/takdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index e555482b23..1676313b7c 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -491,7 +491,7 @@ static int decode_subframe(TAKDecContext *s, int32_t *decoded, s->residues[i + j + 1] * s->filter[j + 1] + s->residues[i + j ] * s->filter[j ]; } - v = (av_clip_intp2(v >> filter_quant, 13) * (1 << dshift)) - *decoded; + v = (av_clip_intp2(v >> filter_quant, 13) * (1 << dshift)) - (unsigned)*decoded; *decoded++ = v; s->residues[filter_order + i] = v >> dshift; }