From patchwork Tue Aug 15 01:32:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4708 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.46.211 with SMTP id u202csp5003415vsu; Mon, 14 Aug 2017 18:33:06 -0700 (PDT) X-Received: by 10.28.167.134 with SMTP id q128mr458200wme.145.1502760786122; Mon, 14 Aug 2017 18:33:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502760786; cv=none; d=google.com; s=arc-20160816; b=zJxZjqElOdiHNp71B3Sxf4UD4b48fK2I3XzlN+FRUC6pbz3Y/MsrIbin4sjRhNBWMt vSDHd8PdoC1kztsspL420wsrWSo74PwSl4RahWBCpkm8eHekEnKl5Km9I/g91ktIjnur kHvI61fTXE6n6Zp0jy2p8G+JjvJ2KQIFTJxfGnvsXMkqP88pusdBcE/7bg1QsJ1fbtZ/ ProbBl3T8VspudpRViIyn2QD62jqCJJHQ8hX0AzNjYM6mo33Y/AwWo8vw8YRof9bB4GC 6Vgpm5DEeLDtKhtMaCBk8F18aoMn9RuVv+LWeh8X6huxrNocwi/GdVL+y0DLStHoTuzb X+CQ== 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=PNbfSuPMJjNYKQUwoxu3z4lbngcrXqfgZ1boR3Hapv4=; b=uGJjX+/gTOGRdSplEtEbmCcglX7J6zVo4XUAqrtxeMuN+ckFSZy6MqCF2uu/7BnrKF BMiV9OeoPBk5JzpCKnTYWqQQIcgWJduhBzGzUqLWQS8xhGddM9t7WVrExE3W7jY7G6G9 ZhpiPA5VfMpJRGrshGsO4oV42Sy7P1Yex4PpZGkitLgjJcOgVro+kFkC9+zJhuH8B14v YYnqJwxKNEMn2LDKXc1ELesgPp33gq6HXRDJ/AXTntZfuuLMnOR62Tirh9wVe62c3ERg yzYOk/oY1AwEpHWF1Iw6Tf/y3Jr0vzMkt4LmUv73j2n/IshxF7Y6Q06fAo4Hx6WBMj/D h2QQ== 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 138si434153wmu.160.2017.08.14.18.33.05; Mon, 14 Aug 2017 18:33:06 -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 7D391689D53; Tue, 15 Aug 2017 04:32:56 +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 9DE3C6891D4 for ; Tue, 15 Aug 2017 04:32:49 +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 1dhQiz-0002p7-8I for ffmpeg-devel@ffmpeg.org; Tue, 15 Aug 2017 03:32:53 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id xDYm1v00H0S5wYM01DYna7; Tue, 15 Aug 2017 03:32:47 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 15 Aug 2017 03:32:44 +0200 Message-Id: <20170815013244.21614-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170815013244.21614-1-michael@niedermayer.cc> References: <20170815013244.21614-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/diracdec: Fixes integer overflow 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: 340018243 * 27 cannot be represented in type 'int' Fixes: 2861/clusterfuzz-testcase-minimized-5361070510178304 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 be8b282314..82c5c158b5 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -442,7 +442,7 @@ static av_cold int dirac_decode_end(AVCodecContext *avctx) static inline int coeff_unpack_golomb(GetBitContext *gb, int qfactor, int qoffset) { int coeff = dirac_get_se_golomb(gb); - const int sign = FFSIGN(coeff); + const unsigned sign = FFSIGN(coeff); if (coeff) coeff = sign*((sign * coeff * qfactor + qoffset) >> 2); return coeff;