Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(641)

Unified Diff: core/src/fxcodec/codec/fx_codec_flate.cpp

Issue 1693913003: Remove the FX_MIN macro. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/include/fxcrt/fx_system.h ('k') | core/src/fxge/win32/fx_win32_gdipext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcodec/codec/fx_codec_flate.cpp
diff --git a/core/src/fxcodec/codec/fx_codec_flate.cpp b/core/src/fxcodec/codec/fx_codec_flate.cpp
index 17f20da1dee4290f3056fbc9311c111e4b6a3894..ce7c9ade03676257a22375faa8d952d7654469b7 100644
--- a/core/src/fxcodec/codec/fx_codec_flate.cpp
+++ b/core/src/fxcodec/codec/fx_codec_flate.cpp
@@ -6,6 +6,7 @@
#include "codec_int.h"
+#include <algorithm>
#include <memory>
#include "core/include/fxcodec/fx_codec.h"
@@ -565,7 +566,8 @@ void TIFF_PredictLine(uint8_t* dest_buf,
int Colors,
int Columns) {
if (BitsPerComponent == 1) {
- int row_bits = FX_MIN(BitsPerComponent * Colors * Columns, row_size * 8);
+ int row_bits = std::min(BitsPerComponent * Colors * Columns,
+ pdfium::base::checked_cast<int>(row_size * 8));
int index_pre = 0;
int col_pre = 0;
for (int i = 1; i < row_bits; i++) {
« no previous file with comments | « core/include/fxcrt/fx_system.h ('k') | core/src/fxge/win32/fx_win32_gdipext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698