| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "core/src/fpdfapi/fpdf_parser/cpdf_syntax_parser.h" | 7 #include "core/src/fpdfapi/fpdf_parser/cpdf_syntax_parser.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 } | 765 } |
| 766 } | 766 } |
| 767 | 767 |
| 768 CPDF_Stream* pStream = new CPDF_Stream(pData, len, pDict); | 768 CPDF_Stream* pStream = new CPDF_Stream(pData, len, pDict); |
| 769 streamStartPos = m_Pos; | 769 streamStartPos = m_Pos; |
| 770 FXSYS_memset(m_WordBuffer, 0, kEndObjStr.GetLength() + 1); | 770 FXSYS_memset(m_WordBuffer, 0, kEndObjStr.GetLength() + 1); |
| 771 | 771 |
| 772 GetNextWordInternal(nullptr); | 772 GetNextWordInternal(nullptr); |
| 773 | 773 |
| 774 int numMarkers = ReadEOLMarkers(m_Pos); | 774 int numMarkers = ReadEOLMarkers(m_Pos); |
| 775 if (m_WordSize == kEndObjStr.GetLength() && numMarkers != 0 && | 775 if (m_WordSize == static_cast<unsigned int>(kEndObjStr.GetLength()) && |
| 776 numMarkers != 0 && |
| 776 FXSYS_memcmp(m_WordBuffer, kEndObjStr.GetPtr(), kEndObjStr.GetLength()) == | 777 FXSYS_memcmp(m_WordBuffer, kEndObjStr.GetPtr(), kEndObjStr.GetLength()) == |
| 777 0) { | 778 0) { |
| 778 m_Pos = streamStartPos; | 779 m_Pos = streamStartPos; |
| 779 } | 780 } |
| 780 return pStream; | 781 return pStream; |
| 781 } | 782 } |
| 782 | 783 |
| 783 void CPDF_SyntaxParser::InitParser(IFX_FileRead* pFileAccess, | 784 void CPDF_SyntaxParser::InitParser(IFX_FileRead* pFileAccess, |
| 784 FX_DWORD HeaderOffset) { | 785 FX_DWORD HeaderOffset) { |
| 785 FX_Free(m_pFileBuf); | 786 FX_Free(m_pFileBuf); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 if (limit && m_Pos == limit) | 981 if (limit && m_Pos == limit) |
| 981 return -1; | 982 return -1; |
| 982 } | 983 } |
| 983 return -1; | 984 return -1; |
| 984 } | 985 } |
| 985 | 986 |
| 986 void CPDF_SyntaxParser::SetEncrypt( | 987 void CPDF_SyntaxParser::SetEncrypt( |
| 987 std::unique_ptr<IPDF_CryptoHandler> pCryptoHandler) { | 988 std::unique_ptr<IPDF_CryptoHandler> pCryptoHandler) { |
| 988 m_pCryptoHandler = std::move(pCryptoHandler); | 989 m_pCryptoHandler = std::move(pCryptoHandler); |
| 989 } | 990 } |
| OLD | NEW |