Increase scaling in linsolve_wiener Reduces likelihood of overflows and re-enables previously disabled overflow tests. Bug: b:330639949, oss-fuzz:68195 Change-Id: I2c3dc9bd5783836d65b3c7a4452061b27cf4c82c (cherry picked from commit 22bcd3de8f4fc43c4e87ef9dedfb40594fb1569b)
diff --git a/av1/encoder/pickrst.c b/av1/encoder/pickrst.c index b0d0d0b..53a70e4 100644 --- a/av1/encoder/pickrst.c +++ b/av1/encoder/pickrst.c
@@ -1176,7 +1176,7 @@ if (abs_akj > max_abs_akj) max_abs_akj = abs_akj; } const int scale_threshold = 1 << 22; - const int scaler_A = max_abs_akj < scale_threshold ? 1 : (1 << 5); + const int scaler_A = max_abs_akj < scale_threshold ? 1 : (1 << 6); const int scaler_c = max_abs_akj < scale_threshold ? 1 : (1 << 7); const int scaler = scaler_c * scaler_A;
diff --git a/test/wiener_test.cc b/test/wiener_test.cc index 052f095..467507f 100644 --- a/test/wiener_test.cc +++ b/test/wiener_test.cc
@@ -1693,7 +1693,7 @@ // A test that reproduces crbug.com/oss-fuzz/68195: signed integer overflow in // linsolve_wiener(). -TEST(SearchWienerTest, DISABLED_8bitSignedIntegerOverflowInLinsolveWiener) { +TEST(SearchWienerTest, 8bitSignedIntegerOverflowInLinsolveWiener) { constexpr int kWidth = 4; constexpr int kHeight = 3; constexpr unsigned char kBuffer[kWidth * kHeight] = { @@ -1861,7 +1861,7 @@ // A test that reproduces b/330639949: signed integer overflow in // linsolve_wiener(). -TEST(SearchWienerTest, DISABLED_12bitSignedIntegerOverflowInLinsolveWiener) { +TEST(SearchWienerTest, 12bitSignedIntegerOverflowInLinsolveWiener) { constexpr int kWidth = 173; constexpr int kHeight = 3; // Since the image format is YUV 4:2:0, aom_img_wrap() expects the buffer is