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

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

Issue 1840483003: Reduce signed/unsigned comparison warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 9 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/fpdftext/fpdf_text_int.cpp ('k') | core/fxcodec/jbig2/JBig2_Context.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcodec/codec/fx_codec_flate.cpp
diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp
index e69c017ee79c271f12886d2ad43a04c4847ecbab..6961dcccb3b4d504d3ebb685fea5622911edf371 100644
--- a/core/fxcodec/codec/fx_codec_flate.cpp
+++ b/core/fxcodec/codec/fx_codec_flate.cpp
@@ -9,6 +9,7 @@
#include <algorithm>
#include <memory>
+#include "core/fxcrt/include/fx_ext.h"
#include "core/include/fxcodec/fx_codec.h"
#include "core/include/fxcodec/fx_codec_flate.h"
#include "third_party/zlib_v128/zlib.h"
@@ -942,7 +943,7 @@ uint32_t CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW,
offset = src_size;
int err = decoder->Decode(NULL, dest_size, src_buf, offset, bEarlyChange);
if (err || dest_size == 0 || dest_size + 1 < dest_size) {
- return static_cast<uint32_t>(-1);
+ return FX_INVALID_OFFSET;
}
}
{
@@ -965,7 +966,7 @@ uint32_t CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW,
ret =
TIFF_Predictor(dest_buf, dest_size, Colors, BitsPerComponent, Columns);
}
- return ret ? offset : static_cast<uint32_t>(-1);
+ return ret ? offset : FX_INVALID_OFFSET;
}
FX_BOOL CCodec_FlateModule::Encode(const uint8_t* src_buf,
uint32_t src_size,
« no previous file with comments | « core/fpdftext/fpdf_text_int.cpp ('k') | core/fxcodec/jbig2/JBig2_Context.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698