--- a/lib/src/gpu/applygainmap_gl.cpp	2025-11-28 11:53:50.186642600 +0100
+++ b/lib/src/gpu/applygainmap_gl.cpp	2025-11-28 11:54:44.197113300 +0100
@@ -411,7 +411,7 @@
         (log2(display_boost) - log2(gainmap_metadata->hdr_capacity_min)) /
         (log2(gainmap_metadata->hdr_capacity_max) - log2(gainmap_metadata->hdr_capacity_min));
     // avoid extrapolating the gain map to fill the displayable range
-    gainmap_weight = CLIP3(0.0f, gainmap_weight, 1.0f);
+    gainmap_weight = CLIP3(gainmap_weight, 0.0f, 1.0f);
   } else {
     gainmap_weight = 1.0f;
   }
