Skip to content
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

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

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
[bug] Buffer overflow when SEI payloadSize > bits left
Fixes #433 .
  • Loading branch information
jcdr428 committed May 30, 2021
commit 3a889a37b5b74a45025aca13ebda394b8f706ef3
5 changes: 5 additions & 0 deletions tsMuxer/hevc.cpp
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