From patchwork Sun May 13 23:07:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 8941 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp3366966jad; Sun, 13 May 2018 16:09:38 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrVk5yS1Awiai/6pYX6H6FuSxACJUS3cxjYAOo4QhiQ62O8QhV1QEvB66m1XSyRxGZTYlXB X-Received: by 2002:adf:8186:: with SMTP id 6-v6mr5653923wra.160.1526252978090; Sun, 13 May 2018 16:09:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526252978; cv=none; d=google.com; s=arc-20160816; b=WZ/CLgQF7pdURS3AkKfuQskWP7W1cMMS3bzm0k/Gi1HfSnqc4VKyXiJpUPyIO/u44Y twt9t/5w+lynaRO008Jiy54pm52jPNZspedKRIDR2rzsZ1bs3Gp0Ocxha69EQ7kTY721 gCn0ceNqnWIlqYnuM5WA2eDx6JEBa96OGnJc+GBooSkPoxTfdnKzf5RGuGhvwCd+9Hsi VO57PNEnafbk6zdKeMMSMkiWChKZ78fXFMiXtA0fAi1f8ymfVrExhcx+pkqE5Y0Zyms4 8VtlPHP859Y+P7puBWnxjNS7UMH+xF3V8pHeAeBkDeAW7EhS7CmkXA7KhSBR+WTbSP83 O6RA== 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=g6XFFy1+769DTsGL0eLCMwQTlCFluduLQ1HLzBSSajo=; b=Uwewex6uSDSaRhxFxGfPF8MsVwOm4IwTlwG71J5h/QOm6KG0aQYqiX1weo6Eq6eVhg jNF+IW2KuHHeKi7fN3dVEJPPVCmO9x4Zz4nCJzCmXDKz0JNXbKSmAAn0yfD8Vo+syLH+ LqCZ0C3nwGWLWoBC9VsJzirAQjS/Ga/jfFZRprlSrpp3t7lHEgS03xJGWLbsao02aLCS 3mMvdkKlCv8AvDabvMY05pR7XoSlkQrKDgDATRRKPBQuoWeWfMAHGeasnkgNIN+jgaEK vPhRNxgtfkcOVJ8hdqhxezVs6UJRpZEHuRnyrOdzyxDrzCektLbehZr1vHOfLVKkeGdP C5RA== 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 k44-v6si6884501wre.219.2018.05.13.16.09.37; Sun, 13 May 2018 16:09:38 -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 E7352689A59; Mon, 14 May 2018 02:08:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe03-2.mx.upcmail.net (vie01a-dmta-pe03-2.mx.upcmail.net [62.179.121.161]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 59A40689796 for ; Mon, 14 May 2018 02:08:50 +0300 (EEST) 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 1fI07L-0004m0-8Z for ffmpeg-devel@ffmpeg.org; Mon, 14 May 2018 01:09:27 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id lz9R1x00J0S5wYM01z9Sdc; Mon, 14 May 2018 01:09:26 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 14 May 2018 01:07:56 +0200 Message-Id: <20180513230756.15878-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180513230756.15878-1-michael@niedermayer.cc> References: <20180513230756.15878-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/dirac_dwt: Fix integer overflow in COMPOSE_DD97iH0 / COMPOSE_DD137iL0 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: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); Fixes: 6500/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-4523620274536448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/dirac_dwt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/dirac_dwt.h b/libavcodec/dirac_dwt.h index 68ebd19560..994dc21d70 100644 --- a/libavcodec/dirac_dwt.h +++ b/libavcodec/dirac_dwt.h @@ -99,10 +99,10 @@ void ff_spatial_idwt_slice2(DWTContext *d, int y); (b1 + (unsigned)((int)(b0 + (unsigned)(b2) + 1) >> 1)) #define COMPOSE_DD97iH0(b0, b1, b2, b3, b4)\ - (int)(((unsigned)(b2) + ((int)(-b0 + 9U*b1 + 9U*b3 - b4 + 8) >> 4))) + (int)(((unsigned)(b2) + ((int)(9U*b1 + 9U*b3 - b4 - b0 + 8) >> 4))) #define COMPOSE_DD137iL0(b0, b1, b2, b3, b4)\ - (int)(((unsigned)(b2) - ((int)(-b0 + 9U*b1 + 9U*b3 - b4 + 16) >> 5))) + (int)(((unsigned)(b2) - ((int)(9U*b1 + 9U*b3 - b4 - b0 + 16) >> 5))) #define COMPOSE_HAARiL0(b0, b1)\ ((int)(b0 - (unsigned)((int)(b1 + 1U) >> 1)))