1
0
mirror of https://github.com/mstorsjo/fdk-aac.git synced 2025-02-19 12:30:35 +01:00

Prevent undefined syncLayerFrameBits in synchronization().

Bug: 146937540
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Idaaa11d95c13220a9f96e6d73d4813492a740954
This commit is contained in:
Fraunhofer IIS FDK 2019-11-13 16:07:33 +01:00 committed by Jean-Michel Trivi
parent 8caa63f329
commit 8fee7605df

View File

@ -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++;
}