Skip to content

Commit

Permalink
added size check before calling extractPMTDescriptors (#860)
Browse files Browse the repository at this point in the history
  • Loading branch information
iwashiira committed Apr 3, 2024
1 parent 5d62a28 commit 94cafe7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tsMuxer/tsPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@ bool TS_program_map_section::deserialize(uint8_t* buffer, const int buf_size)
bitReader.skipBits(4); // reserved
const auto program_info_len = bitReader.getBits<uint16_t>(12);
uint8_t* curPos = bitReader.getBuffer() + bitReader.getBitsCount() / 8;
if (curPos + program_info_len + 4 > bufferEnd)
{
LTRACE(LT_WARN, 0, "Bad PMT table. skipped");
return false;
}
extractPMTDescriptors(curPos, program_info_len);
curPos += program_info_len;
while (curPos < crcPos)
Expand Down

0 comments on commit 94cafe7

Please sign in to comment.