From 80fb87cba6bb4428554e2e8d51eab7dfb935cc07 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Fri, 10 Nov 2023 11:41:19 +0100 Subject: [PATCH] adjust M to be within maximum_sizes and max_pixels --- test_common/harness/imageHelpers.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test_common/harness/imageHelpers.cpp b/test_common/harness/imageHelpers.cpp index 369dbc1417..7fb3ee912f 100644 --- a/test_common/harness/imageHelpers.cpp +++ b/test_common/harness/imageHelpers.cpp @@ -801,6 +801,9 @@ void get_max_sizes( { size_t M = maximum_sizes[0]; + size_t A = max_pixels; + + M = static_cast(fmin(A / M, M)); // Store the size sizes[(*numberOfSizes)][0] = M;