diff options
author | Doug Benedict <doub@cypress.com> | 2017-09-20 14:30:42 -0700 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2018-09-03 09:57:46 +0300 |
commit | 2e23af940d5dae9ef56ba8ba0c745bf56c3545fd (patch) | |
tree | 7b84c47b4906e1e00c3f526b5fde4fc938082f62 /libMpegTPDec/src | |
parent | 574bd5e4073f857ae68c1a8db2dfb225441b2fab (diff) | |
download | fdk-aac-2e23af940d5dae9ef56ba8ba0c745bf56c3545fd.tar.gz fdk-aac-2e23af940d5dae9ef56ba8ba0c745bf56c3545fd.tar.bz2 fdk-aac-2e23af940d5dae9ef56ba8ba0c745bf56c3545fd.zip |
Make sure there are enough bits when reading ADTS header.
Diffstat (limited to 'libMpegTPDec/src')
-rw-r--r-- | libMpegTPDec/src/tpdec_adts.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libMpegTPDec/src/tpdec_adts.cpp b/libMpegTPDec/src/tpdec_adts.cpp index 6dc0275..d6fac21 100644 --- a/libMpegTPDec/src/tpdec_adts.cpp +++ b/libMpegTPDec/src/tpdec_adts.cpp @@ -181,6 +181,9 @@ TRANSPORTDEC_ERROR adtsRead_DecodeHeader(HANDLE_ADTS pAdts, FDKmemcpy(&oldPce, &pAsc->m_progrConfigElement, sizeof(CProgramConfig)); valBits = FDKgetValidBits(hBs); + if (valBits < ADTS_HEADERLENGTH) { + return TRANSPORTDEC_NOT_ENOUGH_BITS; + } /* adts_fixed_header */ bs.mpeg_id = FDKreadBits(hBs, Adts_Length_Id); |