1
0
mirror of https://github.com/mstorsjo/fdk-aac.git synced 2025-06-05 22:39:13 +02:00

Add sanity check for huffman escape sequences in HCR tool.

Bug: 145669389
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Iaa624f3040269b5c84883bc3ee38cad7cd88e54d
This commit is contained in:
Fraunhofer IIS FDK
2019-10-29 13:09:38 +01:00
committed by Jean-Michel Trivi
parent 3700d4ff8f
commit 2334454bc8

View File

@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android Software License for The Fraunhofer FDK AAC Codec Library for Android
© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten © Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved. Forschung e.V. All rights reserved.
1. INTRODUCTION 1. INTRODUCTION
@@ -1324,6 +1324,10 @@ UINT Hcr_State_BODY_SIGN_ESC__ESC_PREFIX(HANDLE_FDK_BITSTREAM bs, void *ptr) {
/* count ones and store sum in escapePrefixUp */ /* count ones and store sum in escapePrefixUp */
if (carryBit == 1) { if (carryBit == 1) {
escapePrefixUp += 1; /* update conter for ones */ escapePrefixUp += 1; /* update conter for ones */
if (escapePrefixUp > 8) {
pHcr->decInOut.errorLog |= STATE_ERROR_BODY_SIGN_ESC__ESC_PREFIX;
return BODY_SIGN_ESC__ESC_PREFIX;
}
/* store updated counter in sideinfo of current codeword */ /* store updated counter in sideinfo of current codeword */
pEscapeSequenceInfo[codewordOffset] &= pEscapeSequenceInfo[codewordOffset] &=