Skip to content

[bug] Buffer overflow when SEI payloadSize > bits left #439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[bug] Buffer overflow when SEI payloadSize > bits left
Fixes #433 .
  • Loading branch information
jcdr428 authored May 30, 2021
commit 3a889a37b5b74a45025aca13ebda394b8f706ef3
5 changes: 5 additions & 0 deletions tsMuxer/hevc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,11 @@ int HevcHdrUnit::deserialize()
nbyte = m_reader.getBits(8);
payloadSize += nbyte;
}
if (m_reader.getBitsLeft() < payloadSize * 8)
{
LTRACE(LT_WARN, 2, "Bad SEI detected. SEI too short");
return 1;
}
if (payloadType == 137 && !isHDR10) // mastering_display_colour_volume
{
isHDR10 = true;
Expand Down