summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec/fx_codec_fax.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcodec/codec/fx_codec_fax.cpp')
-rw-r--r--core/fxcodec/codec/fx_codec_fax.cpp3
1 files changed, 2 insertions, 1 deletions
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<uint8_t>& 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;