Skip to content

Commit

Permalink
Make sure there are enough bits when reading ADTS header.
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Benedict authored and mstorsjo committed Sep 22, 2017
1 parent 8a1ea9c commit fb58727
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libMpegTPDec/src/tpdec_adts.cpp
Original file line number Diff line number Diff line change
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 fb58727

Please sign in to comment.