Skip to content

Commit

Permalink
Check all the rows.
Browse files Browse the repository at this point in the history
A 3 by 1 image would not have its 1st and 3rd lines compared at
the second iteration.

BUG=oss-fuzz:69208

Change-Id: I9213e73995d31907f358310a0b7d5ebb21c1f8b2
  • Loading branch information
vrabaud committed May 24, 2024
1 parent 7ec51c5 commit ee26766
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/enc/predictor_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ static void OptimizeSampling(uint32_t* const image, int full_width,
const int new_square_size = 1 << (best_bits + 1 - bits);
int is_good = 1;
square_size = 1 << (best_bits - bits);
for (y = 0; y + new_square_size <= height; y += new_square_size) {
for (y = 0; y + square_size < height; y += new_square_size) {
// Check the first lines of consecutive line groups.
if (memcmp(&image[y * width], &image[(y + square_size) * width],
width * sizeof(*image)) != 0) {
Expand Down

0 comments on commit ee26766

Please sign in to comment.