Skip to content

Commit 150b9a9

Browse files
authored
determine corrupt aac frame and throw an error
indata underflow in decodeNextElement()
1 parent bf47700 commit 150b9a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/aac_decoder/aac_decoder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* libhelix_HAACDECODER
44
*
55
* Created on: 26.10.2018
6-
* Updated on: 22.12.2022
6+
* Updated on: 09.01.2023
77
************************************************************************************/
88

99
#include "aac_decoder.h"
@@ -1978,6 +1978,7 @@ int AACDecode(uint8_t *inbuf, int *bytesLeft, short *outbuf)
19781978

19791979
do {
19801980
/* parse next syntactic element */
1981+
if(bitsAvail < 0) return ERR_AAC_INDATA_UNDERFLOW;
19811982
err = DecodeNextElement(&inptr, &bitOffset, &bitsAvail);
19821983
if (err)
19831984
return err;

0 commit comments

Comments
 (0)