From 6fc6ce7f62ecad2dae718c88248e7541aaaa3045 Mon Sep 17 00:00:00 2001 From: Wan-Teh Chang Date: Fri, 17 Jan 2025 10:58:58 -0800 Subject: [PATCH] Don't compare gainMapF[0] with itself When finding the min and max values in the gainMapF array, don't compare gainMapF[0] with itself. --- src/gainmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gainmap.c b/src/gainmap.c index d7acc700a5..fe86c087d5 100644 --- a/src/gainmap.c +++ b/src/gainmap.c @@ -363,7 +363,7 @@ avifResult avifFindMinMaxWithoutOutliers(const float * gainMapF, int numPixels, float min = gainMapF[0]; float max = gainMapF[0]; - for (int i = 0; i < numPixels; ++i) { + for (int i = 1; i < numPixels; ++i) { min = AVIF_MIN(min, gainMapF[i]); max = AVIF_MAX(max, gainMapF[i]); }