From patchwork Fri Jul 28 01:22:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4478 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp2680191vsb; Thu, 27 Jul 2017 18:22:55 -0700 (PDT) X-Received: by 10.223.128.47 with SMTP id 44mr2731606wrk.175.1501204974939; Thu, 27 Jul 2017 18:22:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501204974; cv=none; d=google.com; s=arc-20160816; b=iQqVBzQc2NA49CVgPEDh0igKcniINy/PzpCeAZPxL9neQ2HDT9t1EMsM9R2+bHjeKR VKIQS8Vu5rzqpKolzpSQKXXfafdNhdQCYBJp4hKxIkK7XMdrQRtW1nuo8MI9gtoU2hEZ gpr2EamGGzI/aU1ASB0wu2EK/DtIC7BxztHwICaRdx7d5NI8Ccc5XPraqhKwRsJqhdTd 3dAk44jFPFUgz3jx9y68otlckwVuStQSxvSsH3LohwLB7YLLvYlpgmPi4q1WHJjDXH83 pUu+7o7Kb0fUHTSKOTpXM8rr5vQYmoBouhcZSPHEL+ur5RSvFA+i9FBpy2QfNh+wLtvf 10eA== 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=fdnK5RfBio+a+yk4fN+W33/HDb7YY21gPhIRhB8hRFc=; b=Iug9QP38eOzkFLstjvHAyMgNT8s+kg9L2yQOYMbEIYuiCUfFSuShoCWODNRIudCHf1 stk+/7wIJ135zug4ARa9zz+lc8cH6EsqkfcclSqqg/Kh0F9+JBH3bezXz8HKFvaScRA9 hGKJlyK1Wu6dQJQ7LGLpw0BwCbOoMUas0gQ4N6uKkvF6fdprXnh+Pdn1MEbmjJEk/Oxb iUPjC0cT95DuV7RhTzJ6JJ0FIL6T9TsBEfD6rAI+G39wE8qj3ixTlzKCOrPsmiEn8tCt uCSrjYXSJvxRP7leP5A9KnFKLfEc/rV/oT3jp1fhcn4jUf6Z+vSqWHqwkdNw7mun/8tQ +/jA== 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 2si16546061wro.472.2017.07.27.18.22.53; Thu, 27 Jul 2017 18:22:54 -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 E82EA6883EA; Fri, 28 Jul 2017 04:22:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-1.mx.upcmail.net (vie01a-dmta-pe07-1.mx.upcmail.net [84.116.36.17]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 40ED0680957 for ; Fri, 28 Jul 2017 04:22:43 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1datzH-0004T3-ND for ffmpeg-devel@ffmpeg.org; Fri, 28 Jul 2017 03:22:43 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id q1Ni1v00u0S5wYM011NjLD; Fri, 28 Jul 2017 03:22:43 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 28 Jul 2017 03:22:40 +0200 Message-Id: <20170728012240.5464-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170728012240.5464-1-michael@niedermayer.cc> References: <20170728012240.5464-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/dirac_dwt: Fix multiple integer overflows in COMPOSE_DD97iH0() 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: 9 * 335544320 cannot be represented in type 'int' Fixes: 2739/clusterfuzz-testcase-minimized-6737297955356672 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/dirac_dwt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dirac_dwt.h b/libavcodec/dirac_dwt.h index 4d338651fa..62f8472b41 100644 --- a/libavcodec/dirac_dwt.h +++ b/libavcodec/dirac_dwt.h @@ -99,7 +99,7 @@ void ff_spatial_idwt_slice2(DWTContext *d, int y); (b1 + ((b0 + b2 + 1) >> 1)) #define COMPOSE_DD97iH0(b0, b1, b2, b3, b4)\ - (b2 + ((-b0 + 9*b1 + 9*b3 - b4 + 8) >> 4)) + (b2 + ((int)(-b0 + 9U*b1 + 9U*b3 - b4 + 8) >> 4)) #define COMPOSE_DD137iL0(b0, b1, b2, b3, b4)\ (b2 - ((-b0 + 9*b1 + 9*b3 - b4 + 16) >> 5))