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 "../../../include/fpdfapi/fpdf_parser.h" | 7 #include "../../../include/fpdfapi/fpdf_parser.h" |
8 #include "../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../include/fpdfapi/fpdf_module.h" |
9 #include "../../../include/fpdfapi/fpdf_page.h" | 9 #include "../../../include/fpdfapi/fpdf_page.h" |
10 #include "../../../../third_party/numerics/safe_math.h" | 10 #include "../../../../third_party/numerics/safe_math.h" |
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 FX_DWORD totalsize = pObjStream->GetSize(); | 1262 FX_DWORD totalsize = pObjStream->GetSize(); |
1263 CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream((FX_LPBYTE)p
Data, (size_t)totalsize, FALSE)); | 1263 CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream((FX_LPBYTE)p
Data, (size_t)totalsize, FALSE)); |
1264 syntax.InitParser((IFX_FileStream*)file, 0); | 1264 syntax.InitParser((IFX_FileStream*)file, 0); |
1265 while (n) { | 1265 while (n) { |
1266 FX_DWORD thisnum = syntax.GetDirectNum(); | 1266 FX_DWORD thisnum = syntax.GetDirectNum(); |
1267 FX_DWORD thisoff = syntax.GetDirectNum(); | 1267 FX_DWORD thisoff = syntax.GetDirectNum(); |
1268 if (thisnum == objnum) { | 1268 if (thisnum == objnum) { |
1269 if (n == 1) { | 1269 if (n == 1) { |
1270 size = totalsize - (thisoff + offset); | 1270 size = totalsize - (thisoff + offset); |
1271 } else { | 1271 } else { |
1272 FX_DWORD nextnum = syntax.GetDirectNum(); | 1272 syntax.GetDirectNum(); // Skip nextnum. |
1273 FX_DWORD nextoff = syntax.GetDirectNum(); | 1273 FX_DWORD nextoff = syntax.GetDirectNum(); |
1274 size = nextoff - thisoff; | 1274 size = nextoff - thisoff; |
1275 } | 1275 } |
1276 pBuffer = FX_Alloc(FX_BYTE, size); | 1276 pBuffer = FX_Alloc(FX_BYTE, size); |
1277 FXSYS_memcpy32(pBuffer, pData + thisoff + offset, size); | 1277 FXSYS_memcpy32(pBuffer, pData + thisoff + offset, size); |
1278 return; | 1278 return; |
1279 } | 1279 } |
1280 n --; | 1280 n --; |
1281 } | 1281 } |
1282 return; | 1282 return; |
(...skipping 3122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4405 { | 4405 { |
4406 FX_INT32 iSize = m_childNode.GetSize(); | 4406 FX_INT32 iSize = m_childNode.GetSize(); |
4407 for (FX_INT32 i = 0; i < iSize; ++i) { | 4407 for (FX_INT32 i = 0; i < iSize; ++i) { |
4408 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; | 4408 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; |
4409 if (pNode) { | 4409 if (pNode) { |
4410 delete pNode; | 4410 delete pNode; |
4411 } | 4411 } |
4412 } | 4412 } |
4413 m_childNode.RemoveAll(); | 4413 m_childNode.RemoveAll(); |
4414 } | 4414 } |
OLD | NEW |