Avoid unsigned integer overflow in transportDec_InBandConfig() and transportDec_ReadAccessUnit().

Bug: 146937857
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: If2320f3a1ddf6a36c07338100481801a996e455d
This commit is contained in:
Fraunhofer IIS FDK 2019-11-13 16:07:13 +01:00 committed by Jean-Michel Trivi
parent 9ab63ce151
commit 8caa63f329
1 changed files with 3 additions and 2 deletions

View File

@ -482,7 +482,8 @@ TRANSPORTDEC_ERROR transportDec_InBandConfig(HANDLE_TRANSPORTDEC hTp,
for (int i = 0; i < 2; i++) {
if (i > 0) {
FDKpushBack(hBs, newConfigLength * 8 - FDKgetValidBits(hBs));
FDKpushBack(hBs,
(INT)newConfigLength * 8 - (INT)FDKgetValidBits(hBs));
configMode = AC_CM_ALLOC_MEM;
}
/* config transport decoder */
@ -1469,7 +1470,7 @@ TRANSPORTDEC_ERROR transportDec_ReadAccessUnit(const HANDLE_TRANSPORTDEC hTp,
for (i = 0; i < 2; i++) {
if (i > 0) {
FDKpushBack(hBs, bsStart - FDKgetValidBits(hBs));
FDKpushBack(hBs, bsStart - (INT)FDKgetValidBits(hBs));
configMode = AC_CM_ALLOC_MEM;
}