Skip to content
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
7 changes: 7 additions & 0 deletions Source/MediaInfo/Video/File_Av1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@ void File_Av1::Header_Parse()
int64u obu_size{};
if (IsAnnexB) {
Get_leb128 (obu_size, "obu_size");
if (obu_size == 0 && Element_Offset < Element_Size) {
// Prevents looping on zero bytes
// Real AV1 files should have OBU of at least one byte for the OBU header
// Exclude conditions where Get_leb128 runs out of buffer on valid files and returns 0
Reject();
return;
}
obu_size += Element_Offset;
DataMustAlwaysBeComplete = Element_Level > 3;
if (!DataMustAlwaysBeComplete)
Expand Down