From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 72C594A9B8 for ; Thu, 6 Jun 2024 05:13:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 556A768D6E2; Thu, 6 Jun 2024 08:12:58 +0300 (EEST) Received: from vidala.lynne.ee (vidala.pars.ee [116.203.72.101]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0D10F68D516 for ; Thu, 6 Jun 2024 08:12:48 +0300 (EEST) To: ffmpeg-devel@ffmpeg.org Date: Thu, 6 Jun 2024 07:12:35 +0200 Message-ID: <20240606051243.3177266-4-dev@lynne.ee> X-Mailer: git-send-email 2.43.0.381.gb435a96ce8 In-Reply-To: <20240606051243.3177266-1-dev@lynne.ee> References: <20240606051243.3177266-1-dev@lynne.ee> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] aacdec_usac: skip coeff decoding if the number to be decoded is 0 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Lynne via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: Lynne Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Yet another thing not mentioned in the spec. --- libavcodec/aac/aacdec_usac.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c index 97655787ee..5dd489a43b 100644 --- a/libavcodec/aac/aacdec_usac.c +++ b/libavcodec/aac/aacdec_usac.c @@ -572,9 +572,15 @@ static int decode_spectrum_and_dequant_ac(AACDecContext *s, float coef[1024], int gb_count; GetBitContext gb2; - ff_aac_ac_init(&ac, gb); c = ff_aac_ac_map_process(state, reset, N); + if (!len) { + ff_aac_ac_finish(state, 0, N); + return 0; + } + + ff_aac_ac_init(&ac, gb); + /* Backup reader for rolling back by 14 bits at the end */ gb2 = *gb; gb_count = get_bits_count(&gb2); -- 2.43.0.381.gb435a96ce8 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".