[x265] [PATCH] [MASTER] Fix out of bounds in PixelHarness::check_ssimDist

Florian Mayer fmayer at google.com
Tue Mar 10 23:33:22 UTC 2026


---
 source/test/pixelharness.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/source/test/pixelharness.cpp b/source/test/pixelharness.cpp
index 317ea05aa..bfc6da04b 100644
--- a/source/test/pixelharness.cpp
+++ b/source/test/pixelharness.cpp
@@ -2335,9 +2335,10 @@ bool PixelHarness::check_ssimDist(ssimDistortion_t ref, ssimDistortion_t opt)
     for (int i = 0; i < ITERS; i++)
     {
         int index = i % TEST_CASES;
+        int index2 = (i + 10) % TEST_CASES;
         int k1 = rand() % 5, k2 = rand() % 5;
-        ref(pixel_test_buff[index] + j, srcStride[k1], pixel_test_buff[index + 10] + j, dstStride[k2], &ref_dest1, shift, &ref_dest2);
-        opt(pixel_test_buff[index] + j, srcStride[k1], pixel_test_buff[index + 10] + j, dstStride[k2], &opt_dest1, shift, &opt_dest2);
+        ref(pixel_test_buff[index] + j, srcStride[k1], pixel_test_buff[index2] + j, dstStride[k2], &ref_dest1, shift, &ref_dest2);
+        opt(pixel_test_buff[index] + j, srcStride[k1], pixel_test_buff[index2] + j, dstStride[k2], &opt_dest1, shift, &opt_dest2);
 
         if (opt_dest1 != ref_dest1 && opt_dest2 != ref_dest2)
         {
-- 
2.53.0.473.g4a7958ca14-goog



More information about the x265-devel mailing list