Skip to content

Commit

Permalink
added copyLen check (#868)
Browse files Browse the repository at this point in the history
  • Loading branch information
iwashiira committed Apr 27, 2024
1 parent acdfe54 commit 93c9070
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tsMuxer/programStreamDemuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ int ProgramStreamDemuxer::simpleDemuxBlock(DemuxedData& demuxedData, const PIDSe
const uint8_t* payloadData = curBuf + pesPacket->getHeaderLength() + afterPesHeader;
const int pesPayloadLen = pesPacket->getPacketLength() - pesPacket->getHeaderLength() - afterPesHeader;
const int copyLen = FFMIN(pesPayloadLen, (int)(end - payloadData));
if (copyLen < 0) {
THROW(ERR_COMMON, "Invalid copyLen")
}
vect.append(payloadData, copyLen);
m_dataProcessed += copyLen;
discardSize += payloadData - curBuf;
Expand Down

0 comments on commit 93c9070

Please sign in to comment.