| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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 "parser_int.h" | 7 #include "parser_int.h" |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1175 if (pResult == NULL) { | 1175 if (pResult == NULL) { |
| 1176 return TRUE; | 1176 return TRUE; |
| 1177 } | 1177 } |
| 1178 if ((FX_FILESIZE*)pResult - (FX_FILESIZE*)m_SortedOffset.GetData() == | 1178 if ((FX_FILESIZE*)pResult - (FX_FILESIZE*)m_SortedOffset.GetData() == |
| 1179 m_SortedOffset.GetSize() - 1) { | 1179 m_SortedOffset.GetSize() - 1) { |
| 1180 return FALSE; | 1180 return FALSE; |
| 1181 } | 1181 } |
| 1182 FX_FILESIZE size = ((FX_FILESIZE*)pResult)[1] - pos; | 1182 FX_FILESIZE size = ((FX_FILESIZE*)pResult)[1] - pos; |
| 1183 FX_FILESIZE SavedPos = m_Syntax.SavePos(); | 1183 FX_FILESIZE SavedPos = m_Syntax.SavePos(); |
| 1184 m_Syntax.RestorePos(pos); | 1184 m_Syntax.RestorePos(pos); |
| 1185 bForm = m_Syntax.SearchMultiWord("/Form\0stream", TRUE, size) == 0; | 1185 const char kFormStream[] = "/Form\0stream"; |
| 1186 const CFX_ByteStringC kFormStreamStr(kFormStream, sizeof(kFormStream) - 1); |
| 1187 bForm = m_Syntax.SearchMultiWord(kFormStreamStr, TRUE, size) == 0; |
| 1186 m_Syntax.RestorePos(SavedPos); | 1188 m_Syntax.RestorePos(SavedPos); |
| 1187 return TRUE; | 1189 return TRUE; |
| 1188 } | 1190 } |
| 1189 | 1191 |
| 1190 CPDF_Object* CPDF_Parser::ParseIndirectObject(CPDF_IndirectObjects* pObjList, | 1192 CPDF_Object* CPDF_Parser::ParseIndirectObject(CPDF_IndirectObjects* pObjList, |
| 1191 FX_DWORD objnum, | 1193 FX_DWORD objnum, |
| 1192 PARSE_CONTEXT* pContext) { | 1194 PARSE_CONTEXT* pContext) { |
| 1193 if (objnum >= (FX_DWORD)m_CrossRef.GetSize()) | 1195 if (objnum >= (FX_DWORD)m_CrossRef.GetSize()) |
| 1194 return nullptr; | 1196 return nullptr; |
| 1195 | 1197 |
| (...skipping 3803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4999 if (!m_pLinearizedDict) | 5001 if (!m_pLinearizedDict) |
| 5000 return -1; | 5002 return -1; |
| 5001 CPDF_Array* pRange = m_pLinearizedDict->GetArray("H"); | 5003 CPDF_Array* pRange = m_pLinearizedDict->GetArray("H"); |
| 5002 if (!pRange) | 5004 if (!pRange) |
| 5003 return -1; | 5005 return -1; |
| 5004 CPDF_Object* pStreamLen = pRange->GetElementValue(1); | 5006 CPDF_Object* pStreamLen = pRange->GetElementValue(1); |
| 5005 if (!pStreamLen) | 5007 if (!pStreamLen) |
| 5006 return -1; | 5008 return -1; |
| 5007 return pStreamLen->GetInteger(); | 5009 return pStreamLen->GetInteger(); |
| 5008 } | 5010 } |
| OLD | NEW |