From patchwork Sat Sep 9 23:32: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: 5067 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.36.26 with SMTP id f26csp1582289jaa; Sat, 9 Sep 2017 16:33:30 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAin1eijVo0bPG3OJ8fRHrBbYW3MYknSFFhEr6iffQLFp3zvT36IHKWjWpAsssYq8kbuD7D X-Received: by 10.28.111.73 with SMTP id k70mr4154413wmc.84.1505000010208; Sat, 09 Sep 2017 16:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505000010; cv=none; d=google.com; s=arc-20160816; b=g+1cVp9Q4O/jRF7Rq/UXAR3OKSZ4FsfvLeCU63R3eUoyvYFmo5Iii4h3XUNVc2JYJW UQtdwb/NkCUAvKqnjygkWxl8fCqDPw5Zi/dcPFhUSRppeb/jB58Ov4WJbSnK+KKmOpA8 WgFvG38q+y2Uos9YqgFSqvqPzP+pRSCjOBnQWP8RrcNeymIJv8vYKm8NnGTfc/bZuv1x +Kh6alfgCljoRpg9Guwbq1w7tnCS/CGvzCOZiS8rJ/HSaVo9XfiY9S9WB43H9pPif15M b4vHwyPBc8GBX5b7dNmMGt7T27ciFDYucP6hhZjJnRUR5uRTcPl2rVizJByZB52fDLgI W/nA== 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=artJWviSl1WSZgcS6/TzyGI5MkLPv546wbxMx9wbdcc=; b=ZVDL1Q9HgdFEq4iygW1x4FIB3YiPomf1Du/MbpxPgBmi+t+A4UAYvPNdXbVqDId6OY 7y6VJ6AcOoUeF6yptOOsJRZ7JrABIPvoewXhnEDXZM8slUClW2mqaBIRt2wwDbzWPQRt 5bUaZ6Z6HdbjzE2h1kgCZd00aK1x35GfRU6BfuP8BR2ubgJ95+nnGWRCGqaQtvSyn7WL bS9GxsIvWHRKJ77jH9O2o/LRbNn45gZcAWjSfgm173sl8xuHlvirAiOYK1Q4rmYpsddP Rlkzub3joQU5f5xG+0cFGD/vbft5gmYx2cenKSRpdukBBlQkE6j9IuN+UpRF7kQmg+LQ JDCw== 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 b126si3960590wma.207.2017.09.09.16.33.29; Sat, 09 Sep 2017 16:33:30 -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 35279689AD0; Sun, 10 Sep 2017 02:33:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe08-1.mx.upcmail.net (vie01a-dmta-pe08-1.mx.upcmail.net [84.116.36.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 387D8680351 for ; Sun, 10 Sep 2017 02:33:10 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe08.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dqpFS-0004IF-GJ for ffmpeg-devel@ffmpeg.org; Sun, 10 Sep 2017 01:33:14 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id 7bYt1w00i0S5wYM01bYuDx; Sun, 10 Sep 2017 01:32:54 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 10 Sep 2017 01:32:50 +0200 Message-Id: <20170909233252.23566-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.14.1 Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/diracdec: Fix overflow in DC computation 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: 11896 + 2147483646 cannot be represented in type 'int' Fixes: 3053/clusterfuzz-testcase-minimized-6355082062856192 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 f2aed6057d..0abb8b0599 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -1421,7 +1421,7 @@ static void decode_block_params(DiracContext *s, DiracArith arith[8], DiracBlock if (!block->ref) { pred_block_dc(block, stride, x, y); for (i = 0; i < 3; i++) - block->u.dc[i] += dirac_get_arith_int(arith+1+i, CTX_DC_F1, CTX_DC_DATA); + block->u.dc[i] += (unsigned)dirac_get_arith_int(arith+1+i, CTX_DC_F1, CTX_DC_DATA); return; }