From patchwork Sun Aug 27 23:33:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4862 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp1840543jao; Sun, 27 Aug 2017 16:34:14 -0700 (PDT) X-Received: by 10.223.169.79 with SMTP id u73mr2927059wrc.17.1503876854453; Sun, 27 Aug 2017 16:34:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503876854; cv=none; d=google.com; s=arc-20160816; b=OvqbxVIejnAKBf+vv1yOjeOiTuq7rJcYGQjQrLNsOacHJV/M4s0QKa7DLX0riNUKmL 8BXP4U2PsZAygznzxAFRsq2LKQ0EcNzdPAnyl8yHSUb9T1UJdsrFj/BGx4mZXMu0DVqz 3x7R05XfCbbry4GiLDio8ohBPjDtSle1yzjmfq5t+GK3Jl9wS6bAcj6YY7nSIYoxvu38 JH1XctM2RV2YItTIlkMpBmMAP00YOvxMJXxO686a4gKMCMZD0jynCGi85YsYEjAD7Xn2 ddqP3f315ZBQcA+knY9N6n8i/aTOx1qKBWB2Cx2ey6r4M8no/1JaE7CRDKoctISfU7Gm 4abQ== 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=FJUalrj/jq9i3jcyBuQvScE5qHnvOWmr/BQ/kL/Va8w=; b=hfN0UJ1+1HmYsLWdJDmnHkEAHMHp2/rbiQHeoD1fZ5klNBRFkNAxi6C9A8mbX7yQH4 KZCVpMkbtZNfHUV1T+eFw2kTF7mCBIGWiQlGn4LFYERbGqwm6J6RfR6zGMPblTy9vY7s KKwm6BD4g3XywXUDWUS9dF2g3udZTRpARExIWORaUs3sIMQ1Q0zmuy0SjKCgP5mCWCCH whs7L0Nmq+//RXt+NBAYjMtfsKvomG2h3TA69xuSovQemSxbMNzrF+WSh4B5FsLBH5PK pBOGkw+YC18u5Pemc7bjQVUKXRZOtZ8vhnA4uVs6ucQ6gAe7+esFWHgZhUag3kMZWlmw cZVQ== 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 o79si5109177wmg.62.2017.08.27.16.34.14; Sun, 27 Aug 2017 16:34:14 -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 078F7689D9E; Mon, 28 Aug 2017 02:33:57 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-1.mx.upcmail.net (vie01a-qmta-pe02-1.mx.upcmail.net [62.179.121.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6972268186B for ; Mon, 28 Aug 2017 02:33:50 +0300 (EEST) Received: from [172.31.218.46] (helo=vie01a-dmta-pe05-1.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dm743-000056-MO for ffmpeg-devel@ffmpeg.org; Mon, 28 Aug 2017 01:33:59 +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 1dm73y-00043J-1q for ffmpeg-devel@ffmpeg.org; Mon, 28 Aug 2017 01:33:54 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id 2PZr1w01F0S5wYM01PZsj9; Mon, 28 Aug 2017 01:33:53 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 28 Aug 2017 01:33:50 +0200 Message-Id: <20170827233350.5037-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170827233350.5037-1-michael@niedermayer.cc> References: <20170827233350.5037-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/snowdec: Fix integer overflow in decode_subband_slice_buffered() 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: 267 * 8388608 cannot be represented in type 'int' Fixes: 2743/clusterfuzz-testcase-minimized-5820652076400640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/snowdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index 734f43e7d1..b74c468ce3 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -140,7 +140,7 @@ static inline void decode_subband_slice_buffered(SnowContext *s, SubBand *b, sli v = b->x_coeff[new_index].coeff; x = b->x_coeff[new_index++].x; while(x < w){ - register int t= ( (v>>1)*qmul + qadd)>>QEXPSHIFT; + register int t= (int)( (v>>1)*(unsigned)qmul + qadd)>>QEXPSHIFT; register int u= -(v&1); line[x] = (t^u) - u;