Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make sure there are enough bits when reading ADTS header.
  • Loading branch information
Doug Benedict committed Sep 20, 2017
1 parent a3d1168 commit e2e35b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libMpegTPDec/src/tpdec_adts.cpp
Expand Up @@ -185,6 +185,9 @@ TRANSPORTDEC_ERROR adtsRead_DecodeHeader(
#endif

valBits = FDKgetValidBits(hBs);
if (valBits < ADTS_HEADERLENGTH) {
return TRANSPORTDEC_NOT_ENOUGH_BITS;
}

/* adts_fixed_header */
bs.mpeg_id = FDKreadBits(hBs, Adts_Length_Id);
Expand Down

0 comments on commit e2e35b8

Please sign in to comment.