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;