summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-16 16:22:37 -0700
committerLei Zhang <thestig@chromium.org>2015-10-16 16:22:37 -0700
commitc40ccaff017691b7d31e0597863bfb954aebd739 (patch)
tree4f5f09c672393e130037826256ab182e2d2ae7f5 /core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
parenta725bc9a3525256976c112b2b5a429a119cf9b69 (diff)
downloadpdfium-c40ccaff017691b7d31e0597863bfb954aebd739.tar.xz
Merge to XFA: Fix a bunch of sign mismatch warnings.
Also remove some gotos and move code into an anonymous namespace. And then do the partial revert to avoid size_t going negative. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1356373003 . Review URL: https://codereview.chromium.org/1400723002 . (cherry picked from commit d03ba8d1a5928e8f3f6bd7da063b53b0bc40abfd) (cherry picked from commit a398ca611d1925182ff6a4e8b2b43c277c364dc0) Review URL: https://codereview.chromium.org/1406373002 .
Diffstat (limited to 'core/src/fxcodec/codec/fx_codec_jpx_opj.cpp')
-rw-r--r--core/src/fxcodec/codec/fx_codec_jpx_opj.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
index 9b0f42b343..616af36b00 100644
--- a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -658,7 +658,7 @@ class CJPX_Decoder {
public:
explicit CJPX_Decoder(bool use_colorspace);
~CJPX_Decoder();
- FX_BOOL Init(const unsigned char* src_data, int src_size);
+ FX_BOOL Init(const unsigned char* src_data, FX_DWORD src_size);
void GetInfo(FX_DWORD* width, FX_DWORD* height, FX_DWORD* components);
bool Decode(uint8_t* dest_buf,
int pitch,
@@ -666,7 +666,7 @@ class CJPX_Decoder {
private:
const uint8_t* m_SrcData;
- int m_SrcSize;
+ FX_DWORD m_SrcSize;
opj_image_t* image;
opj_codec_t* l_codec;
opj_stream_t* l_stream;
@@ -692,12 +692,12 @@ CJPX_Decoder::~CJPX_Decoder() {
}
}
-FX_BOOL CJPX_Decoder::Init(const unsigned char* src_data, int src_size) {
+FX_BOOL CJPX_Decoder::Init(const unsigned char* src_data, FX_DWORD src_size) {
static const unsigned char szJP2Header[] = {
0x00, 0x00, 0x00, 0x0c, 0x6a, 0x50, 0x20, 0x20, 0x0d, 0x0a, 0x87, 0x0a};
- if (!src_data || src_size < sizeof(szJP2Header)) {
+ if (!src_data || src_size < sizeof(szJP2Header))
return FALSE;
- }
+
image = NULL;
m_SrcData = src_data;
m_SrcSize = src_size;