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 2167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2178 if (key == FX_BSTRC("endobj")) { | 2178 if (key == FX_BSTRC("endobj")) { |
2179 dwDictSize = m_Pos - 6 - saveDictOffset; | 2179 dwDictSize = m_Pos - 6 - saveDictOffset; |
2180 m_Pos = SavedPos; | 2180 m_Pos = SavedPos; |
2181 break; | 2181 break; |
2182 } | 2182 } |
2183 if (key[0] != '/') { | 2183 if (key[0] != '/') { |
2184 continue; | 2184 continue; |
2185 } | 2185 } |
2186 nKeys ++; | 2186 nKeys ++; |
2187 key = PDF_NameDecode(key); | 2187 key = PDF_NameDecode(key); |
2188 if (key.IsEmpty()) { | |
jun_fang
2014/10/29 18:21:50
IsEmpty is checked at Ln2168. If key is not empty
| |
2189 if (pDict) | |
2190 pDict->Release(); | |
2191 return NULL; | |
2192 } | |
2188 if (key == FX_BSTRC("/Contents")) { | 2193 if (key == FX_BSTRC("/Contents")) { |
2189 dwSignValuePos = m_Pos; | 2194 dwSignValuePos = m_Pos; |
2190 } | 2195 } |
2191 CPDF_Object* pObj = GetObject(pObjList, objnum, gennum, level + 1); | 2196 CPDF_Object* pObj = GetObject(pObjList, objnum, gennum, level + 1); |
2192 if (pObj == NULL) { | 2197 if (pObj == NULL) { |
2193 continue; | 2198 continue; |
2194 } | 2199 } |
2195 if (key.GetLength() == 1) { | 2200 if (key.GetLength() == 1) { |
Tom Sepez
2014/10/29 18:49:41
Maybe instead we just check here for key.GetLength
jun_fang
2014/10/29 18:58:29
I am checking the code here. I think that the curr
| |
2196 pDict->SetAt(CFX_ByteStringC(((FX_LPCSTR)key) + 1, key.GetLength () - 1), pObj); | 2201 pDict->SetAt(CFX_ByteStringC(((FX_LPCSTR)key) + 1, key.GetLength () - 1), pObj); |
2197 } else { | 2202 } else { |
2198 if (nKeys < 32) { | 2203 if (nKeys < 32) { |
2199 pDict->SetAt(CFX_ByteStringC(((FX_LPCSTR)key) + 1, key.GetLe ngth() - 1), pObj); | 2204 pDict->SetAt(CFX_ByteStringC(((FX_LPCSTR)key) + 1, key.GetLe ngth() - 1), pObj); |
2200 } else { | 2205 } else { |
2201 pDict->AddValue(CFX_ByteStringC(((FX_LPCSTR)key) + 1, key.Ge tLength() - 1), pObj); | 2206 pDict->AddValue(CFX_ByteStringC(((FX_LPCSTR)key) + 1, key.Ge tLength() - 1), pObj); |
2202 } | 2207 } |
2203 } | 2208 } |
2204 } | 2209 } |
2205 if (IsSignatureDict(pDict)) { | 2210 if (IsSignatureDict(pDict)) { |
(...skipping 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4433 { | 4438 { |
4434 FX_INT32 iSize = m_childNode.GetSize(); | 4439 FX_INT32 iSize = m_childNode.GetSize(); |
4435 for (FX_INT32 i = 0; i < iSize; ++i) { | 4440 for (FX_INT32 i = 0; i < iSize; ++i) { |
4436 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; | 4441 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; |
4437 if (pNode) { | 4442 if (pNode) { |
4438 delete pNode; | 4443 delete pNode; |
4439 } | 4444 } |
4440 } | 4445 } |
4441 m_childNode.RemoveAll(); | 4446 m_childNode.RemoveAll(); |
4442 } | 4447 } |
OLD | NEW |