Skip to content

Commit

Permalink
Do not test incr line count on fuzzed grids (#2160)
Browse files Browse the repository at this point in the history
Add an explanation about the tamed check.

BUG=oss-fuzz:68972
  • Loading branch information
y-guyon committed May 13, 2024
1 parent 67230c5 commit 8d1c719
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/gtest/avifincrtest_helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,16 @@ uint32_t GetMinDecodedRowCount(uint32_t height, uint32_t cell_height,
if (available_byte_count >= byte_count) {
return height;
}
// All but one cell should be decoded if at most 10 bytes are missing.
if ((available_byte_count + 10) >= byte_count) {
return height - cell_height;
}

// The tests below can be hard to tune for any kind of input, especially
// fuzzed grids. Early exit in that case.
// fuzzed grids, where tile ordering is unknown. Early exit in that case.
if (!enable_fine_incremental_check) return 0;

// There is no valid AV1 payload smaller than 10 bytes, so all but one cell
// should be decoded if at most 10 bytes are missing.
if ((available_byte_count + 10) >= byte_count) {
return height - cell_height;
}
// Subtract the header because decoding it does not output any pixel.
// Most AVIF headers are below 500 bytes.
if (available_byte_count <= 500) {
Expand Down

0 comments on commit 8d1c719

Please sign in to comment.