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/fxge/dib/fx_dib_engine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/fxge/dib/fx_dib_engine.cpp') diff --git a/core/fxge/dib/fx_dib_engine.cpp b/core/fxge/dib/fx_dib_engine.cpp index 8d90a72401..5975a5e975 100644 --- a/core/fxge/dib/fx_dib_engine.cpp +++ b/core/fxge/dib/fx_dib_engine.cpp @@ -11,6 +11,7 @@ #include "core/fxge/dib/dib_int.h" #include "core/fxge/fx_dib.h" #include "third_party/base/ptr_util.h" +#include "third_party/base/stl_util.h" namespace { @@ -984,7 +985,7 @@ bool CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause) { dest_y = m_LineIndex; src_y = (dest_y + m_ClipRect.top) * src_height / m_DestHeight; } - src_y = std::max(std::min(src_y, src_height - 1), 0); + src_y = pdfium::clamp(src_y, 0, src_height - 1); if (m_pSource->SkipToScanline(src_y, pPause)) return true; -- cgit v1.2.3