Skip to content

Commit

Permalink
Update matroskaParser.cpp
Browse files Browse the repository at this point in the history
to fix heap buffer over-read
  • Loading branch information
JP3BGY authored Aug 9, 2024
1 parent 7f8667d commit f5b62fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tsMuxer/matroskaParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ void ParsedH264TrackData::extractData(AVPacket* pkt, uint8_t* buff, const int si
else
THROW(ERR_COMMON, "Unsupported nal unit size " << elSize)
writeNalHeader(dst);
assert((curPos[m_nalSize] & 0x80) == 0);
memcpy(dst, curPos + m_nalSize, FFMIN(elSize, (uint32_t)(end - curPos)));
assert((curPos < end - m_nalSize) && (curPos[m_nalSize] & 0x80) == 0);
memcpy(dst, curPos + m_nalSize, FFMIN(elSize, (uint32_t)(end - curPos - m_nalSize)));
curPos += elSize + m_nalSize;
dst += elSize;
}
Expand Down

0 comments on commit f5b62fa

Please sign in to comment.