From 85f019a8e7d33cbba368a6c6b75fd091269e14a1 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 17 Mar 2017 15:14:19 -0700 Subject: Add pdfium::clamp() as a placeholder for std::clamp(). Ue it to fix a typo as well. BUG=pdfium:634 Change-Id: I2d686242ffb841aedc2fae6a3cf7a00bea667404 Reviewed-on: https://pdfium-review.googlesource.com/3113 Commit-Queue: Lei Zhang Reviewed-by: Tom Sepez --- core/fxcodec/codec/fx_codec_fax.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/fxcodec/codec') diff --git a/core/fxcodec/codec/fx_codec_fax.cpp b/core/fxcodec/codec/fx_codec_fax.cpp index 46792a6003..7865da925e 100644 --- a/core/fxcodec/codec/fx_codec_fax.cpp +++ b/core/fxcodec/codec/fx_codec_fax.cpp @@ -12,6 +12,7 @@ #include "core/fxcodec/fx_codec.h" #include "core/fxcrt/fx_memory.h" #include "third_party/base/ptr_util.h" +#include "third_party/base/stl_util.h" namespace { @@ -104,7 +105,7 @@ void FaxG4FindB1B2(const std::vector& ref_buf, void FaxFillBits(uint8_t* dest_buf, int columns, int startpos, int endpos) { startpos = std::max(startpos, 0); - endpos = std::min(std::max(endpos, 0), columns); + endpos = pdfium::clamp(endpos, 0, columns); if (startpos >= endpos) return; -- cgit v1.2.3