Skip to content

Commit

Permalink
item: Disallow grid boxes with extra bytes
Browse files Browse the repository at this point in the history
There cannot be any trailing bytes in the grid box.

PiperOrigin-RevId: 655207768
  • Loading branch information
vigneshvg authored and copybara-github committed Jul 23, 2024
1 parent 94464a9 commit 9b963c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Binary file added poc_b_354563288.avif
Binary file not shown.
5 changes: 5 additions & 0 deletions src/decoder/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ impl Item {
"grid dimensions too large".into(),
));
}
if stream.has_bytes_left()? {
return Err(AvifError::InvalidImageGrid(
"found unknown extra bytes in the grid box".into(),
));
}
Ok(())
}

Expand Down

0 comments on commit 9b963c9

Please sign in to comment.