From patchwork Thu Jul 27 21:49:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4476 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp2508465vsb; Thu, 27 Jul 2017 14:49:51 -0700 (PDT) X-Received: by 10.28.149.129 with SMTP id x123mr4285504wmd.171.1501192191487; Thu, 27 Jul 2017 14:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501192191; cv=none; d=google.com; s=arc-20160816; b=v1wJTffkawY0kRDMPxOjbJ8nZ6ReTAg/DTzTJCuRZicSYxdGWfD7Xs1p7rrbIK14sX ttS0U2Ry3Ty5h720IIk0jv8tkwdfZ4w2at33CtVXwf9abxuRIixpFo2LJ4VsqGhCu7kJ AjKlS319vKzUeUrneir7YZwhJP2zT8twKJ1JzqCpA/nXCyWuB/hJZuaKNRM4BWYCzbAe Aeh00AYwQcXEa5Sd3wJfOVBVoPBZCQOPGAaTp/CLfZIYVQhNaxjib4DQ7fbiSwxHEV9/ Wy2rjxKsnq8b43wRzSCdn7CQ0Ygsn/fRSP70ViBozaJwZYor5FYScIMQmndHK7jvOYlw CQJg== 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=lWyoPYDIPjoQjvOT/PdQLihYKJ5y3/K6GgwY/q5IjvI=; b=mappCc1+8/T6l6R0kGoX5loHocK/e1HcmyKi58rXfzpwvcJfrldW+R4avslgfbh/sa S1qcPmp+eWzv+Suhev7KocMiAGW3DCkmEBRAqlaRRRyzsHockRCHW30gBgQdLZjTkrWo SyFV+Xk1EhrgepjI9ml+Wim8BIJmIA3r7B1KY/s0hZt9lz0w5LoJ5VHvuuiIGfA2e0RG Da9kIyLartMurYZTjCKCNiISYKMsHhka9uQ9unkzgDYpX+SbbSj5ZHN7Q4TRXwjV6eUN WqTlupIfadoDouq79RU3y/h8XSmFfPeaImUj8mzYX3Dzd6JpDYK6VzgOEP6RrKmMgPKU gl5g== 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 k129si11631953wme.42.2017.07.27.14.49.51; Thu, 27 Jul 2017 14:49:51 -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 46B3E68839D; Fri, 28 Jul 2017 00:49:45 +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 978D9688357 for ; Fri, 28 Jul 2017 00:49:36 +0300 (EEST) Received: from [172.31.218.49] (helo=vie01a-dmta-pe05-1.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1daqf3-0003y8-FE for ffmpeg-devel@ffmpeg.org; Thu, 27 Jul 2017 23:49:37 +0200 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 1daqex-0004Bb-Uq for ffmpeg-devel@ffmpeg.org; Thu, 27 Jul 2017 23:49:31 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id pxpU1v01J0S5wYM01xpVb6; Thu, 27 Jul 2017 23:49:29 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 27 Jul 2017 23:49:27 +0200 Message-Id: <20170727214927.22553-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170727214927.22553-1-michael@niedermayer.cc> References: <20170727214927.22553-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/diracdec: Fix integer overflow in divide3() 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: -1073746548 * 21845 cannot be represented in type 'int' Fixes: 2729/clusterfuzz-testcase-minimized-5902915464069120 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/diracdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index d2262ebbf5..d2aaeab011 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -249,7 +249,7 @@ enum dirac_subband { /* magic number division by 3 from schroedinger */ static inline int divide3(int x) { - return ((x+1)*21845 + 10922) >> 16; + return (int)((x+1U)*21845 + 10922) >> 16; } static DiracFrame *remove_frame(DiracFrame *framelist[], int picnum)