From 0afbad0509578a5fee6fec4394d6b3c55425cf28 Mon Sep 17 00:00:00 2001 From: Oliver Chang Date: Fri, 20 Nov 2015 10:01:48 -0800 Subject: Merge to XFA: Change |CCodec_ScanlineDecoder::m_Pitch| to FX_DWORD This matches the type of the corresponding |CFX_DIBSource::m_Pitch|, where integer overflow is checked for FX_DWORD. This change is propagated to many other places. Also, check for integer overflow in |CCodec_RLScanlineDecoder::Create| during the calculation of |m_Pitch| since it aligns to 4 bytes while overflow was was previously checked without this alignment. TBR=tsepez@chromium.org BUG=555784 Review URL: https://codereview.chromium.org/1460033002 . (cherry picked from commit e7950df70a2fd658f466751b29483436cb31e829) Review URL: https://codereview.chromium.org/1461363002 . --- core/src/fxcodec/codec/codec_int.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/src/fxcodec/codec/codec_int.h') diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h index 5513abce73..3d2acaf8c0 100644 --- a/core/src/fxcodec/codec/codec_int.h +++ b/core/src/fxcodec/codec/codec_int.h @@ -58,7 +58,7 @@ class CCodec_ScanlineDecoder : public ICodec_ScanlineDecoder { protected: class ImageDataCache { public: - ImageDataCache(int width, int height, int pitch); + ImageDataCache(int width, int height, FX_DWORD pitch); ~ImageDataCache(); bool AllocateCache(); @@ -75,7 +75,7 @@ class CCodec_ScanlineDecoder : public ICodec_ScanlineDecoder { const int m_Width; const int m_Height; - const int m_Pitch; + const FX_DWORD m_Pitch; int m_nCachedLines; nonstd::unique_ptr m_Data; }; @@ -93,7 +93,7 @@ class CCodec_ScanlineDecoder : public ICodec_ScanlineDecoder { int m_OutputHeight; int m_nComps; int m_bpc; - int m_Pitch; + FX_DWORD m_Pitch; FX_BOOL m_bColorTransformed; int m_NextLine; uint8_t* m_pLastScanline; -- cgit v1.2.3