Check all the rows.

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
This commit is contained in:
Vincent Rabaud 2024-05-24 23:03:00 +02:00
parent 7ec51c5916
commit ee26766a89

View File

@ -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) {