aboutsummaryrefslogtreecommitdiffstats
path: root/libMpegTPDec/src
diff options
context:
space:
mode:
Diffstat (limited to 'libMpegTPDec/src')
-rw-r--r--libMpegTPDec/src/tpdec_adts.cpp3
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);