diff options
Diffstat (limited to 'core/src/fpdfapi')
5 files changed, 25 insertions, 34 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp index cafca2623c..8cd9f2bdb5 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp @@ -1036,8 +1036,8 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause) for (i = 0; i < m_nStreams; i ++) { FX_DWORD size = m_pStreamArray[i]->GetSize(); if (m_Size + size + 1 <= m_Size) { - m_Status = Done; - return; + m_Status = Done; + return; } m_Size += size + 1; } diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp index 35b9726b4a..c705ea7357 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -2401,7 +2401,7 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict, PARSE_CONTEXT { CPDF_Object* pLenObj = pDict->GetElement(FX_BSTRC("Length")); FX_DWORD len = 0; - if (pLenObj && (pLenObj->GetType() != PDFOBJ_REFERENCE || + if (pLenObj && ((pLenObj->GetType() != PDFOBJ_REFERENCE) || ((((CPDF_Reference*)pLenObj)->GetObjList() != NULL) && ((CPDF_Reference*)pLenObj)->GetRefObjNum() != objnum))) { FX_FILESIZE pos = m_Pos; diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp index 19624329fb..611804bc06 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp @@ -508,7 +508,7 @@ FX_BOOL CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj, const CFX_Affi } CPDF_RenderStatus status; status.Initialize(m_Level + 1, m_pContext, m_pDevice, NULL, m_pStopObj, - this, pFormObj, &m_Options, m_Transparency, m_bDropObjects, pResources, TRUE); + this, pFormObj, &m_Options, m_Transparency, m_bDropObjects, pResources, FALSE); status.m_curBlend = m_curBlend; m_pDevice->SaveState(); status.RenderObjectList(pFormObj->m_pForm, &matrix); diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index e67b46c931..91a3725ad7 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -911,37 +911,33 @@ void CPDF_DIBSource::LoadPalette() } } } - FX_DWORD CPDF_DIBSource::GetValidBpp() const { FX_DWORD bpc = m_bpc; CPDF_Object * pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter")); - if(pFilter) - { - if(pFilter->GetType() == PDFOBJ_NAME) - { + if (pFilter) { + if (pFilter->GetType() == PDFOBJ_NAME) { CFX_ByteString filter = pFilter->GetString(); - if(filter == FX_BSTRC("CCITTFaxDecode") || filter == FX_BSTRC("JBIG2Decode") ) + if (filter == FX_BSTRC("CCITTFaxDecode") || filter == FX_BSTRC("JBIG2Decode")) { bpc = 1; - if(filter == FX_BSTRC("RunLengthDecode") || filter == FX_BSTRC("DCTDecode") ) + } + if (filter == FX_BSTRC("RunLengthDecode") || filter == FX_BSTRC("DCTDecode")) { bpc = 8; + } + } else if (pFilter->GetType() == PDFOBJ_ARRAY) { + CPDF_Array *pArray = (CPDF_Array *)pFilter; + if (pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("CCITTFacDecode") || + pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("JBIG2Decode")) { + bpc = 1; + } + if (pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("RunLengthDecode") || + pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("DCTDecode")) { + bpc = 8; + } } - else if (pFilter->GetType() == PDFOBJ_ARRAY) - { - CPDF_Array *pArray = (CPDF_Array *) pFilter; - if( pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("CCITTFacDecode") || - pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("JBIG2Decode") ) - bpc = 1; - - if( pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("RunLengthDecode") || - pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("DCTDecode") ) - bpc = 8; - } - } - + } return bpc; } - #define NORMALCOLOR_MAX(color, max) (color) > (max) ? (max) : (color) < 0 ? 0 : (color); void CPDF_DIBSource::TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan) const { @@ -969,9 +965,7 @@ void CPDF_DIBSource::TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_ } else { int src_bit_pos = 0; int dest_byte_pos = 0; - FX_DWORD bpc = GetValidBpp(); - for (int column = 0; column < m_Width; column ++) { int R = _GetBits8(src_scan, src_bit_pos, bpc); src_bit_pos += bpc; @@ -990,9 +984,9 @@ void CPDF_DIBSource::TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_ } return; } else if (m_bpc == 8) { - if (m_nComponents == m_pColorSpace->CountComponents()) - m_pColorSpace->TranslateImageLine(dest_scan, src_scan, m_Width, m_Width, m_Height, - m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK); + if (m_nComponents == m_pColorSpace->CountComponents()) + m_pColorSpace->TranslateImageLine(dest_scan, src_scan, m_Width, m_Width, m_Height, + m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK); return; } } @@ -1027,9 +1021,7 @@ void CPDF_DIBSource::TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_ } else { int src_bit_pos = 0; int dest_byte_pos = 0; - FX_DWORD bpc = GetValidBpp(); - for (int column = 0; column < m_Width; column ++) { for (FX_DWORD color = 0; color < m_nComponents; color ++) { int data = _GetBits8(src_scan, src_bit_pos, bpc); diff --git a/core/src/fpdfapi/fpdf_render/render_int.h b/core/src/fpdfapi/fpdf_render/render_int.h index 9bde4be877..e8e8ea4651 100644 --- a/core/src/fpdfapi/fpdf_render/render_int.h +++ b/core/src/fpdfapi/fpdf_render/render_int.h @@ -419,8 +419,7 @@ protected: void LoadPalette(); FX_BOOL CreateDecoder(); void TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan) const; - FX_DWORD GetValidBpp() const; - + FX_DWORD GetValidBpp() const; CPDF_Document* m_pDocument; const CPDF_Stream* m_pStream; CPDF_StreamAcc* m_pStreamAcc; |