From patchwork Thu May 16 11:12:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 13136 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 948D7449A01 for ; Thu, 16 May 2019 14:18:22 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 69CF968A924; Thu, 16 May 2019 14:18:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe08-3.mx.upcmail.net (vie01a-dmta-pe08-3.mx.upcmail.net [84.116.36.22]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E2D7A68A920 for ; Thu, 16 May 2019 14:18:15 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe08.mx.upcmail.net with esmtp (Exim 4.91) (envelope-from ) id 1hREJx-0003Qm-0V for ffmpeg-devel@ffmpeg.org; Thu, 16 May 2019 13:13:09 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id REIyh6j405D5NREIzh4twn; Thu, 16 May 2019 13:12:09 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.41.20 X-CNFS-Analysis: v=2.3 cv=bu8y+3Si c=1 sm=1 tr=0 a=I1eytVlZLDX1BM2VTtTtSw==:117 a=I1eytVlZLDX1BM2VTtTtSw==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=-pmIIYUl2Fvu42_OOJsA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 16 May 2019 13:12:05 +0200 Message-Id: <20190516111205.12971-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190516111205.12971-1-michael@niedermayer.cc> References: <20190516111205.12971-1-michael@niedermayer.cc> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfBJ/mSLX+UxH/oKgqz4kAiwWSt5M6ECHj2Wn3LaXts9CDPcX4avI+DRImtGv9Tb003bFDjvWZXO+JN3uC4swUiGosLiIw0zhyEm0i5khYAG+jeQCxt9T PWltHWwDaceJ5DWQXS6O3XtfrShOs8Ez+71M8orVCAvMEXKE6NAu3jic Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/aacdec_fixed: Handle more extreem cases in noise_scale() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Its unclear if these cases have any relevance in real files Fixes: shift exponent -2 is negative Fixes: 14489/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5681941631729664 Signed-off-by: Michael Niedermayer --- libavcodec/aacdec_fixed.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index 0808c81005..1d0142fdb0 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -221,10 +221,15 @@ static void noise_scale(int *coefs, int scale, int band_energy, int len) } else { s = s + 32; - round = s ? 1 << (s-1) : 0; - for (i=0; i> s); - coefs[i] = -out; + if (s > 0) { + round = 1 << (s-1); + for (i=0; i> s); + coefs[i] = -out; + } + } else { + for (i=0; i