From patchwork Fri Oct 27 00:23:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 5709 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp112470jah; Thu, 26 Oct 2017 17:23:43 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RxirR9hWG0AAmGXvYyk4UI+xu7Kskj+GakltKEFE0uVTnciLc6qv9RNtxAlTZqI5U269wV X-Received: by 10.223.162.152 with SMTP id s24mr7134358wra.173.1509063823012; Thu, 26 Oct 2017 17:23:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509063822; cv=none; d=google.com; s=arc-20160816; b=rThOWSyKolyunO110xCEpFlAjT/FUGanAqrvkTvlv7+4OAexvhJCwZmNnORMCvn0mP 0q+C5vNcf96uyhsmi1iNvztVSLKxNjzahXxjwgRjdDBfdR+jNHrCXvF81JNAf62Mqslf rQ5Tw1XKcdtSBhV/KU4HRoreNN8Sjv6lvE3BXh6z7SVuQ2DBdtiMBPxIm0csjQvTsMbY T6dbmbB9t1t9hn5sm2+Dt1Uv2RThVfDaNdNQSUq2I9+/NPkTtki1T4lYdoRlnGocZUJX eZ/hEsozkezr6zRr4pLf+RUKJYgAX2nfF/fdK4Cm+GlcLfsh8VLkIobaYu1yiEH+/Da6 a6Zg== 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=NCzZKxYwRgOzCnRQBHErAUlUutBWJiGd3OkenkWEDpM=; b=PF29QnCH13OgU9vkVvZdtavD4SHPhOp9LsKSh/4fz4k9FAQCfiw25UY60/ipRi7vA7 SdDnJaVadRBO38uDeVsRpiSlPWzDVyUr2xhl12Hq7lY9KgSBJfrHtd5xIMiKb8frW/9T zXL3eha5OxXLodP06BY6ob8gsvvwkqDxY+YrsPL1ZhcWe0mYdU7t9Y6O2dJthi2O4tYp wVTmANWRKY5h3w3zHQsajcPoYe9XeNjrV8Z4tpkRSyX2HwSJXhurUeJ9MLZzuIOrl08J QQ9Vunz7hT1cLRFoyM89tgQU9dl28gPWThD+iet3VXqY91QasFIP0Grz9erTPPPBrCFG bLSA== 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 10si348216wmf.71.2017.10.26.17.23.42; Thu, 26 Oct 2017 17:23:42 -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 C446A68A251; Fri, 27 Oct 2017 03:23:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe06-3.mx.upcmail.net (vie01a-dmta-pe06-3.mx.upcmail.net [84.116.36.16]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 825BC68A19F for ; Fri, 27 Oct 2017 03:23:22 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1e7sQs-0004mC-MA for ffmpeg-devel@ffmpeg.org; Fri, 27 Oct 2017 02:23:30 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id SQPN1w00d0S5wYM01QPPyQ; Fri, 27 Oct 2017 02:23:23 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 27 Oct 2017 02:23:20 +0200 Message-Id: <20171027002321.12800-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.14.2 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/aacdec_fixed: Fix integer overflow in predict() 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: -2110708110 + -82837504 cannot be represented in type 'int' Fixes: 3547/clusterfuzz-testcase-minimized-6009386439802880 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/aacdec_fixed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index f6a533010f..5e9249ceea 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -307,9 +307,9 @@ static av_always_inline void predict(PredictorState *ps, int *coef, if (shift < 31) { if (shift > 0) { - *coef += (pv.mant + (1 << (shift - 1))) >> shift; + *coef += (unsigned)((pv.mant + (1 << (shift - 1))) >> shift); } else - *coef += pv.mant << -shift; + *coef += (unsigned)(pv.mant << -shift); } }