diff options
Diffstat (limited to 'core/fpdfapi/fpdf_page')
-rw-r--r-- | core/fpdfapi/fpdf_page/cpdf_page.cpp | 7 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp | 14 |
2 files changed, 13 insertions, 8 deletions
diff --git a/core/fpdfapi/fpdf_page/cpdf_page.cpp b/core/fpdfapi/fpdf_page/cpdf_page.cpp index 0da5452969..2c01cd5573 100644 --- a/core/fpdfapi/fpdf_page/cpdf_page.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_page.cpp @@ -140,7 +140,12 @@ void CPDF_Page::GetDisplayMatrix(CFX_Matrix& matrix, return; } CFX_Matrix display_matrix; - int x0, y0, x1, y1, x2, y2; + int x0 = 0; + int y0 = 0; + int x1 = 0; + int y1 = 0; + int x2 = 0; + int y2 = 0; iRotate %= 4; switch (iRotate) { case 0: diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp index c9f05ac5ab..87ed09735a 100644 --- a/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp +++ b/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp @@ -41,11 +41,11 @@ CPDF_StreamParser::~CPDF_StreamParser() { } } -FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, - uint8_t*& dest_buf, - FX_DWORD& dest_size) { +FX_DWORD DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, + uint8_t*& dest_buf, + FX_DWORD& dest_size) { if (!pDecoder) { - return (FX_DWORD)-1; + return static_cast<FX_DWORD>(-1); } int ncomps = pDecoder->CountComps(); int bpc = pDecoder->GetBPC(); @@ -54,7 +54,7 @@ FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, int pitch = (width * ncomps * bpc + 7) / 8; if (height == 0 || pitch > (1 << 30) / height) { delete pDecoder; - return -1; + return static_cast<FX_DWORD>(-1); } dest_buf = FX_Alloc2D(uint8_t, pitch, height); dest_size = pitch * height; // Safe since checked alloc returned. @@ -88,7 +88,7 @@ FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf, if (decoder == "CCITTFaxDecode" || decoder == "CCF") { ICodec_ScanlineDecoder* pDecoder = FPDFAPI_CreateFaxDecoder(src_buf, limit, width, height, pParam); - return _DecodeAllScanlines(pDecoder, dest_buf, dest_size); + return DecodeAllScanlines(pDecoder, dest_buf, dest_size); } if (decoder == "ASCII85Decode" || decoder == "A85") { return A85Decode(src_buf, limit, dest_buf, dest_size); @@ -109,7 +109,7 @@ FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf, CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder( src_buf, limit, width, height, 0, pParam ? pParam->GetIntegerBy("ColorTransform", 1) : 1); - return _DecodeAllScanlines(pDecoder, dest_buf, dest_size); + return DecodeAllScanlines(pDecoder, dest_buf, dest_size); } if (decoder == "RunLengthDecode" || decoder == "RL") { return RunLengthDecode(src_buf, limit, dest_buf, dest_size); |