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 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
995 result = result * 256 + p[i]; | 995 result = result * 256 + p[i]; |
996 } | 996 } |
997 return result; | 997 return result; |
998 } | 998 } |
999 FX_BOOL CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL bMainXRef) | 999 FX_BOOL CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL bMainXRef) |
1000 { | 1000 { |
1001 CPDF_Stream* pStream = (CPDF_Stream*)ParseIndirectObjectAt(m_pDocument, pos, 0, NULL); | 1001 CPDF_Stream* pStream = (CPDF_Stream*)ParseIndirectObjectAt(m_pDocument, pos, 0, NULL); |
1002 if (!pStream) { | 1002 if (!pStream) { |
1003 return FALSE; | 1003 return FALSE; |
1004 } | 1004 } |
1005 if (m_pDocument) { | 1005 if (m_pDocument && m_pDocument->GetRoot()->GetObjNum() != pStream->m_ObjNum) { |
Bo Xu
2014/12/15 17:49:25
Could GetRoot() return null?
jun_fang
2014/12/15 18:46:48
m_pRootDict is returned from GetRoot().It's assign
Tom Sepez
2014/12/15 19:33:43
How about returning false if this is the case? Is
| |
1006 m_pDocument->InsertIndirectObject(pStream->m_ObjNum, pStream); | 1006 m_pDocument->InsertIndirectObject(pStream->m_ObjNum, pStream); |
1007 } | 1007 } |
1008 if (pStream->GetType() != PDFOBJ_STREAM) { | 1008 if (pStream->GetType() != PDFOBJ_STREAM) { |
1009 return FALSE; | 1009 return FALSE; |
1010 } | 1010 } |
1011 prev = pStream->GetDict()->GetInteger(FX_BSTRC("Prev")); | 1011 prev = pStream->GetDict()->GetInteger(FX_BSTRC("Prev")); |
1012 FX_INT32 size = pStream->GetDict()->GetInteger(FX_BSTRC("Size")); | 1012 FX_INT32 size = pStream->GetDict()->GetInteger(FX_BSTRC("Size")); |
1013 if (size < 0) { | 1013 if (size < 0) { |
1014 pStream->Release(); | 1014 pStream->Release(); |
1015 return FALSE; | 1015 return FALSE; |
(...skipping 3402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4418 { | 4418 { |
4419 FX_INT32 iSize = m_childNode.GetSize(); | 4419 FX_INT32 iSize = m_childNode.GetSize(); |
4420 for (FX_INT32 i = 0; i < iSize; ++i) { | 4420 for (FX_INT32 i = 0; i < iSize; ++i) { |
4421 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; | 4421 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; |
4422 if (pNode) { | 4422 if (pNode) { |
4423 delete pNode; | 4423 delete pNode; |
4424 } | 4424 } |
4425 } | 4425 } |
4426 m_childNode.RemoveAll(); | 4426 m_childNode.RemoveAll(); |
4427 } | 4427 } |
OLD | NEW |