summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/dib/cfx_imagetransformer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp
index 4b5fe0b0e0..11f5f56ecb 100644
--- a/core/fxge/dib/cfx_imagetransformer.cpp
+++ b/core/fxge/dib/cfx_imagetransformer.cpp
@@ -57,7 +57,7 @@ uint8_t bicubic_interpol(const uint8_t* buf,
s_result += a_result * v_w[i];
}
s_result >>= 16;
- return (uint8_t)(s_result < 0 ? 0 : s_result > 255 ? 255 : s_result);
+ return static_cast<uint8_t>(pdfium::clamp(s_result, 0, 255));
}
void bicubic_get_pos_weight(int pos_pixel[],