diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2019-11-13 16:07:33 +0100 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2020-01-14 16:39:37 -0800 |
commit | 8fee7605df2d8759a63faa3d0b1aac7d95dfc1af (patch) | |
tree | b5dc46b62c2ec44f29a9a6bf4560c1811b2c985f /libMpegTPDec/src | |
parent | 8caa63f329c26fcf8dda71ed0a928a7c39c0f839 (diff) | |
download | fdk-aac-8fee7605df2d8759a63faa3d0b1aac7d95dfc1af.tar.gz fdk-aac-8fee7605df2d8759a63faa3d0b1aac7d95dfc1af.tar.bz2 fdk-aac-8fee7605df2d8759a63faa3d0b1aac7d95dfc1af.zip |
Prevent undefined syncLayerFrameBits in synchronization().
Bug: 146937540
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Idaaa11d95c13220a9f96e6d73d4813492a740954
Diffstat (limited to 'libMpegTPDec/src')
-rw-r--r-- | libMpegTPDec/src/tpdec_lib.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libMpegTPDec/src/tpdec_lib.cpp b/libMpegTPDec/src/tpdec_lib.cpp index 617f9a1..7bebbaa 100644 --- a/libMpegTPDec/src/tpdec_lib.cpp +++ b/libMpegTPDec/src/tpdec_lib.cpp @@ -981,6 +981,9 @@ static TRANSPORTDEC_ERROR transportDec_readHeader( CLatmDemux_GetNrOfSubFrames(&hTp->parser.latm); if (hTp->transportFmt == TT_MP4_LOAS) { syncLayerFrameBits -= startPos - (INT)FDKgetValidBits(hBs) - (13); + if (syncLayerFrameBits <= 0) { + err = TRANSPORTDEC_SYNC_ERROR; + } } } } else { @@ -1271,8 +1274,9 @@ static TRANSPORTDEC_ERROR synchronization(HANDLE_TRANSPORTDEC hTp, if (!(hTp->flags & (TPDEC_LOST_FRAMES_PENDING | TPDEC_IGNORE_BUFFERFULLNESS | TPDEC_SYNCOK)) && err == TRANSPORTDEC_OK) { - err = additionalHoldOffNeeded(hTp, transportDec_GetBufferFullness(hTp), - FDKgetValidBits(hBs) - syncLayerFrameBits); + err = + additionalHoldOffNeeded(hTp, transportDec_GetBufferFullness(hTp), + (INT)FDKgetValidBits(hBs) - syncLayerFrameBits); if (err == TRANSPORTDEC_NOT_ENOUGH_BITS) { hTp->holdOffFrames++; } |