Make sure there are enough bits when reading ADTS header.

This commit is contained in:
Doug Benedict 2017-09-20 14:30:42 -07:00 committed by Martin Storsjo
parent b51c73991c
commit 944114bb04
1 changed files with 3 additions and 0 deletions

View File

@ -181,6 +181,9 @@ TRANSPORTDEC_ERROR adtsRead_DecodeHeader(HANDLE_ADTS pAdts,
FDKmemcpy(&oldPce, &pAsc->m_progrConfigElement, sizeof(CProgramConfig)); FDKmemcpy(&oldPce, &pAsc->m_progrConfigElement, sizeof(CProgramConfig));
valBits = FDKgetValidBits(hBs); valBits = FDKgetValidBits(hBs);
if (valBits < ADTS_HEADERLENGTH) {
return TRANSPORTDEC_NOT_ENOUGH_BITS;
}
/* adts_fixed_header */ /* adts_fixed_header */
bs.mpeg_id = FDKreadBits(hBs, Adts_Length_Id); bs.mpeg_id = FDKreadBits(hBs, Adts_Length_Id);