Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: core/fpdfapi/parser/cpdf_parser.cpp

Issue 2384883003: Remove CPDF_Object::Release() in favor of direct delete (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfapi/parser/cpdf_object_unittest.cpp ('k') | core/fpdfapi/parser/cpdf_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/fpdfapi/parser/cpdf_parser.h" 7 #include "core/fpdfapi/parser/cpdf_parser.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 m_pTrailer(nullptr), 54 m_pTrailer(nullptr),
55 m_pEncryptDict(nullptr), 55 m_pEncryptDict(nullptr),
56 m_bVersionUpdated(false), 56 m_bVersionUpdated(false),
57 m_pLinearized(nullptr), 57 m_pLinearized(nullptr),
58 m_dwFirstPageNo(0), 58 m_dwFirstPageNo(0),
59 m_dwXrefStartObjNum(0) { 59 m_dwXrefStartObjNum(0) {
60 m_pSyntax.reset(new CPDF_SyntaxParser); 60 m_pSyntax.reset(new CPDF_SyntaxParser);
61 } 61 }
62 62
63 CPDF_Parser::~CPDF_Parser() { 63 CPDF_Parser::~CPDF_Parser() {
64 if (m_pTrailer) 64 delete m_pTrailer;
65 m_pTrailer->Release();
66
67 ReleaseEncryptHandler(); 65 ReleaseEncryptHandler();
68 SetEncryptDictionary(nullptr); 66 SetEncryptDictionary(nullptr);
69 67
70 if (m_bOwnFileRead && m_pSyntax->m_pFileAccess) { 68 if (m_bOwnFileRead && m_pSyntax->m_pFileAccess) {
71 m_pSyntax->m_pFileAccess->Release(); 69 m_pSyntax->m_pFileAccess->Release();
72 m_pSyntax->m_pFileAccess = nullptr; 70 m_pSyntax->m_pFileAccess = nullptr;
73 } 71 }
74 72
75 for (CPDF_Dictionary* trailer : m_Trailers) { 73 for (CPDF_Dictionary* trailer : m_Trailers)
76 if (trailer) 74 delete trailer;
77 trailer->Release();
78 }
79 75
80 if (m_pLinearized) 76 delete m_pLinearized;
81 m_pLinearized->Release();
82 } 77 }
83 78
84 uint32_t CPDF_Parser::GetLastObjNum() const { 79 uint32_t CPDF_Parser::GetLastObjNum() const {
85 return m_ObjectInfo.empty() ? 0 : m_ObjectInfo.rbegin()->first; 80 return m_ObjectInfo.empty() ? 0 : m_ObjectInfo.rbegin()->first;
86 } 81 }
87 82
88 bool CPDF_Parser::IsValidObjectNumber(uint32_t objnum) const { 83 bool CPDF_Parser::IsValidObjectNumber(uint32_t objnum) const {
89 return !m_ObjectInfo.empty() && objnum <= m_ObjectInfo.rbegin()->first; 84 return !m_ObjectInfo.empty() && objnum <= m_ObjectInfo.rbegin()->first;
90 } 85 }
91 86
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 // Check for circular references. 345 // Check for circular references.
351 if (pdfium::ContainsKey(seen_xrefpos, xrefpos)) 346 if (pdfium::ContainsKey(seen_xrefpos, xrefpos))
352 return false; 347 return false;
353 348
354 seen_xrefpos.insert(xrefpos); 349 seen_xrefpos.insert(xrefpos);
355 350
356 // SLOW ... 351 // SLOW ...
357 CrossRefList.insert(CrossRefList.begin(), xrefpos); 352 CrossRefList.insert(CrossRefList.begin(), xrefpos);
358 LoadCrossRefV4(xrefpos, 0, true); 353 LoadCrossRefV4(xrefpos, 0, true);
359 354
360 std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> pDict( 355 std::unique_ptr<CPDF_Dictionary> pDict(LoadTrailerV4());
361 LoadTrailerV4());
362 if (!pDict) 356 if (!pDict)
363 return false; 357 return false;
364 358
365 xrefpos = GetDirectInteger(pDict.get(), "Prev"); 359 xrefpos = GetDirectInteger(pDict.get(), "Prev");
366 360
367 // SLOW ... 361 // SLOW ...
368 XRefStreamList.insert(XRefStreamList.begin(), 362 XRefStreamList.insert(XRefStreamList.begin(),
369 pDict->GetIntegerFor("XRefStm")); 363 pDict->GetIntegerFor("XRefStm"));
370 m_Trailers.push_back(pDict.release()); 364 m_Trailers.push_back(pDict.release());
371 } 365 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 // Check for circular references. 399 // Check for circular references.
406 if (pdfium::ContainsKey(seen_xrefpos, xrefpos)) 400 if (pdfium::ContainsKey(seen_xrefpos, xrefpos))
407 return false; 401 return false;
408 402
409 seen_xrefpos.insert(xrefpos); 403 seen_xrefpos.insert(xrefpos);
410 404
411 // SLOW ... 405 // SLOW ...
412 CrossRefList.insert(CrossRefList.begin(), xrefpos); 406 CrossRefList.insert(CrossRefList.begin(), xrefpos);
413 LoadCrossRefV4(xrefpos, 0, true); 407 LoadCrossRefV4(xrefpos, 0, true);
414 408
415 std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> pDict( 409 std::unique_ptr<CPDF_Dictionary> pDict(LoadTrailerV4());
416 LoadTrailerV4());
417 if (!pDict) 410 if (!pDict)
418 return false; 411 return false;
419 412
420 xrefpos = GetDirectInteger(pDict.get(), "Prev"); 413 xrefpos = GetDirectInteger(pDict.get(), "Prev");
421 414
422 // SLOW ... 415 // SLOW ...
423 XRefStreamList.insert(XRefStreamList.begin(), 416 XRefStreamList.insert(XRefStreamList.begin(),
424 pDict->GetIntegerFor("XRefStm")); 417 pDict->GetIntegerFor("XRefStm"));
425 m_Trailers.push_back(pDict.release()); 418 m_Trailers.push_back(pDict.release());
426 } 419 }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 return false; 576 return false;
584 } 577 }
585 m_ObjectStreamMap.clear(); 578 m_ObjectStreamMap.clear();
586 m_bXRefStream = true; 579 m_bXRefStream = true;
587 return true; 580 return true;
588 } 581 }
589 582
590 bool CPDF_Parser::RebuildCrossRef() { 583 bool CPDF_Parser::RebuildCrossRef() {
591 m_ObjectInfo.clear(); 584 m_ObjectInfo.clear();
592 m_SortedOffset.clear(); 585 m_SortedOffset.clear();
593 if (m_pTrailer) { 586 delete m_pTrailer;
594 m_pTrailer->Release(); 587 m_pTrailer = nullptr;
595 m_pTrailer = nullptr;
596 }
597 588
598 ParserState state = ParserState::kDefault; 589 ParserState state = ParserState::kDefault;
599
600 int32_t inside_index = 0; 590 int32_t inside_index = 0;
601 uint32_t objnum = 0; 591 uint32_t objnum = 0;
602 uint32_t gennum = 0; 592 uint32_t gennum = 0;
603 int32_t depth = 0; 593 int32_t depth = 0;
604
605 const uint32_t kBufferSize = 4096; 594 const uint32_t kBufferSize = 4096;
606 std::vector<uint8_t> buffer(kBufferSize); 595 std::vector<uint8_t> buffer(kBufferSize);
607 596
608 FX_FILESIZE pos = m_pSyntax->m_HeaderOffset; 597 FX_FILESIZE pos = m_pSyntax->m_HeaderOffset;
609 FX_FILESIZE start_pos = 0; 598 FX_FILESIZE start_pos = 0;
610 FX_FILESIZE start_pos1 = 0; 599 FX_FILESIZE start_pos1 = 0;
611 FX_FILESIZE last_obj = -1; 600 FX_FILESIZE last_obj = -1;
612 FX_FILESIZE last_xref = -1; 601 FX_FILESIZE last_xref = -1;
613 FX_FILESIZE last_trailer = -1; 602 FX_FILESIZE last_trailer = -1;
614 603
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 CPDF_Object* pObject = ParseIndirectObjectAtByStrict( 737 CPDF_Object* pObject = ParseIndirectObjectAtByStrict(
749 m_pDocument, obj_pos, objnum, &obj_end); 738 m_pDocument, obj_pos, objnum, &obj_end);
750 if (CPDF_Stream* pStream = ToStream(pObject)) { 739 if (CPDF_Stream* pStream = ToStream(pObject)) {
751 if (CPDF_Dictionary* pDict = pStream->GetDict()) { 740 if (CPDF_Dictionary* pDict = pStream->GetDict()) {
752 if ((pDict->KeyExist("Type")) && 741 if ((pDict->KeyExist("Type")) &&
753 (pDict->GetStringFor("Type") == "XRef" && 742 (pDict->GetStringFor("Type") == "XRef" &&
754 pDict->KeyExist("Size"))) { 743 pDict->KeyExist("Size"))) {
755 CPDF_Object* pRoot = pDict->GetObjectFor("Root"); 744 CPDF_Object* pRoot = pDict->GetObjectFor("Root");
756 if (pRoot && pRoot->GetDict() && 745 if (pRoot && pRoot->GetDict() &&
757 pRoot->GetDict()->GetObjectFor("Pages")) { 746 pRoot->GetDict()->GetObjectFor("Pages")) {
758 if (m_pTrailer) 747 delete m_pTrailer;
759 m_pTrailer->Release();
760 m_pTrailer = ToDictionary(pDict->Clone()); 748 m_pTrailer = ToDictionary(pDict->Clone());
761 } 749 }
762 } 750 }
763 } 751 }
764 } 752 }
765 753
766 FX_FILESIZE offset = 0; 754 FX_FILESIZE offset = 0;
767 m_pSyntax->RestorePos(obj_pos); 755 m_pSyntax->RestorePos(obj_pos);
768 offset = m_pSyntax->FindTag("obj", 0); 756 offset = m_pSyntax->FindTag("obj", 0);
769 if (offset == -1) 757 if (offset == -1)
(...skipping 17 matching lines...) Expand all
787 m_ObjectInfo[objnum].gennum = gennum; 775 m_ObjectInfo[objnum].gennum = gennum;
788 if (oldgen != gennum) 776 if (oldgen != gennum)
789 m_bVersionUpdated = true; 777 m_bVersionUpdated = true;
790 } 778 }
791 } else { 779 } else {
792 m_ObjectInfo[objnum].pos = obj_pos; 780 m_ObjectInfo[objnum].pos = obj_pos;
793 m_ObjectInfo[objnum].type = 1; 781 m_ObjectInfo[objnum].type = 1;
794 m_ObjectInfo[objnum].gennum = gennum; 782 m_ObjectInfo[objnum].gennum = gennum;
795 } 783 }
796 784
797 if (pObject) 785 delete pObject;
798 pObject->Release();
799 } 786 }
800 --i; 787 --i;
801 state = ParserState::kDefault; 788 state = ParserState::kDefault;
802 break; 789 break;
803 } 790 }
804 break; 791 break;
805 792
806 case ParserState::kTrailer: 793 case ParserState::kTrailer:
807 if (inside_index == 7) { 794 if (inside_index == 7) {
808 if (PDFCharIsWhitespace(byte) || PDFCharIsDelimiter(byte)) { 795 if (PDFCharIsWhitespace(byte) || PDFCharIsDelimiter(byte)) {
809 last_trailer = pos + i - 7; 796 last_trailer = pos + i - 7;
810 m_pSyntax->RestorePos(pos + i - m_pSyntax->m_HeaderOffset); 797 m_pSyntax->RestorePos(pos + i - m_pSyntax->m_HeaderOffset);
811 798
812 CPDF_Object* pObj = m_pSyntax->GetObject(m_pDocument, 0, 0, true); 799 CPDF_Object* pObj = m_pSyntax->GetObject(m_pDocument, 0, 0, true);
813 if (pObj) { 800 if (pObj) {
814 if (!pObj->IsDictionary() && !pObj->AsStream()) { 801 if (!pObj->IsDictionary() && !pObj->AsStream()) {
815 pObj->Release(); 802 delete pObj;
816 } else { 803 } else {
817 CPDF_Stream* pStream = pObj->AsStream(); 804 CPDF_Stream* pStream = pObj->AsStream();
818 if (CPDF_Dictionary* pTrailer = 805 if (CPDF_Dictionary* pTrailer =
819 pStream ? pStream->GetDict() : pObj->AsDictionary()) { 806 pStream ? pStream->GetDict() : pObj->AsDictionary()) {
820 if (m_pTrailer) { 807 if (m_pTrailer) {
821 CPDF_Object* pRoot = pTrailer->GetObjectFor("Root"); 808 CPDF_Object* pRoot = pTrailer->GetObjectFor("Root");
822 CPDF_Reference* pRef = ToReference(pRoot); 809 CPDF_Reference* pRef = ToReference(pRoot);
823 if (!pRoot || 810 if (!pRoot ||
824 (pRef && IsValidObjectNumber(pRef->GetRefObjNum()) && 811 (pRef && IsValidObjectNumber(pRef->GetRefObjNum()) &&
825 m_ObjectInfo[pRef->GetRefObjNum()].pos != 0)) { 812 m_ObjectInfo[pRef->GetRefObjNum()].pos != 0)) {
826 auto it = pTrailer->begin(); 813 auto it = pTrailer->begin();
827 while (it != pTrailer->end()) { 814 while (it != pTrailer->end()) {
828 const CFX_ByteString& key = it->first; 815 const CFX_ByteString& key = it->first;
829 CPDF_Object* pElement = it->second; 816 CPDF_Object* pElement = it->second;
830 ++it; 817 ++it;
831 uint32_t dwObjNum = 818 uint32_t dwObjNum =
832 pElement ? pElement->GetObjNum() : 0; 819 pElement ? pElement->GetObjNum() : 0;
833 if (dwObjNum) { 820 if (dwObjNum) {
834 m_pTrailer->SetReferenceFor(key, m_pDocument, 821 m_pTrailer->SetReferenceFor(key, m_pDocument,
835 dwObjNum); 822 dwObjNum);
836 } else { 823 } else {
837 m_pTrailer->SetFor(key, pElement->Clone()); 824 m_pTrailer->SetFor(key, pElement->Clone());
838 } 825 }
839 } 826 }
840 } 827 }
841 pObj->Release(); 828 delete pObj;
842 } else { 829 } else {
843 if (pObj->IsStream()) { 830 if (pObj->IsStream()) {
844 m_pTrailer = ToDictionary(pTrailer->Clone()); 831 m_pTrailer = ToDictionary(pTrailer->Clone());
845 pObj->Release(); 832 delete pObj;
846 } else { 833 } else {
847 m_pTrailer = pTrailer; 834 m_pTrailer = pTrailer;
848 } 835 }
849 836
850 FX_FILESIZE dwSavePos = m_pSyntax->SavePos(); 837 FX_FILESIZE dwSavePos = m_pSyntax->SavePos();
851 CFX_ByteString strWord = m_pSyntax->GetKeyword(); 838 CFX_ByteString strWord = m_pSyntax->GetKeyword();
852 if (!strWord.Compare("startxref")) { 839 if (!strWord.Compare("startxref")) {
853 bool bNumber; 840 bool bNumber;
854 CFX_ByteString bsOffset = 841 CFX_ByteString bsOffset =
855 m_pSyntax->GetNextWord(&bNumber); 842 m_pSyntax->GetNextWord(&bNumber);
856 if (bNumber) 843 if (bNumber)
857 m_LastXRefOffset = FXSYS_atoi(bsOffset.c_str()); 844 m_LastXRefOffset = FXSYS_atoi(bsOffset.c_str());
858 } 845 }
859 m_pSyntax->RestorePos(dwSavePos); 846 m_pSyntax->RestorePos(dwSavePos);
860 } 847 }
861 } else { 848 } else {
862 pObj->Release(); 849 delete pObj;
863 } 850 }
864 } 851 }
865 } 852 }
866 } 853 }
867 --i; 854 --i;
868 state = ParserState::kDefault; 855 state = ParserState::kDefault;
869 } else if (byte == "trailer"[inside_index]) { 856 } else if (byte == "trailer"[inside_index]) {
870 inside_index++; 857 inside_index++;
871 } else { 858 } else {
872 --i; 859 --i;
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 *pResultPos = m_pSyntax->m_Pos; 1398 *pResultPos = m_pSyntax->m_Pos;
1412 1399
1413 m_pSyntax->RestorePos(SavedPos); 1400 m_pSyntax->RestorePos(SavedPos);
1414 return pObj; 1401 return pObj;
1415 } 1402 }
1416 1403
1417 CPDF_Dictionary* CPDF_Parser::LoadTrailerV4() { 1404 CPDF_Dictionary* CPDF_Parser::LoadTrailerV4() {
1418 if (m_pSyntax->GetKeyword() != "trailer") 1405 if (m_pSyntax->GetKeyword() != "trailer")
1419 return nullptr; 1406 return nullptr;
1420 1407
1421 std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> pObj( 1408 std::unique_ptr<CPDF_Object> pObj(
1422 m_pSyntax->GetObject(m_pDocument, 0, 0, true)); 1409 m_pSyntax->GetObject(m_pDocument, 0, 0, true));
1423 if (!ToDictionary(pObj.get())) 1410 if (!ToDictionary(pObj.get()))
1424 return nullptr; 1411 return nullptr;
1425 return pObj.release()->AsDictionary(); 1412 return pObj.release()->AsDictionary();
1426 } 1413 }
1427 1414
1428 uint32_t CPDF_Parser::GetPermissions() const { 1415 uint32_t CPDF_Parser::GetPermissions() const {
1429 if (!m_pSecurityHandler) 1416 if (!m_pSecurityHandler)
1430 return 0xFFFFFFFF; 1417 return 0xFFFFFFFF;
1431 1418
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 m_pLinearized = m_pSyntax->GetObject(nullptr, objnum, gennum, true); 1450 m_pLinearized = m_pSyntax->GetObject(nullptr, objnum, gennum, true);
1464 if (!m_pLinearized) 1451 if (!m_pLinearized)
1465 return false; 1452 return false;
1466 1453
1467 CPDF_Dictionary* pDict = m_pLinearized->GetDict(); 1454 CPDF_Dictionary* pDict = m_pLinearized->GetDict();
1468 if (pDict && pDict->GetObjectFor("Linearized")) { 1455 if (pDict && pDict->GetObjectFor("Linearized")) {
1469 m_pSyntax->GetNextWord(nullptr); 1456 m_pSyntax->GetNextWord(nullptr);
1470 1457
1471 CPDF_Object* pLen = pDict->GetObjectFor("L"); 1458 CPDF_Object* pLen = pDict->GetObjectFor("L");
1472 if (!pLen) { 1459 if (!pLen) {
1473 m_pLinearized->Release(); 1460 delete m_pLinearized;
1474 m_pLinearized = nullptr; 1461 m_pLinearized = nullptr;
1475 return false; 1462 return false;
1476 } 1463 }
1477 1464
1478 if (pLen->GetInteger() != (int)pFileAccess->GetSize()) 1465 if (pLen->GetInteger() != (int)pFileAccess->GetSize())
1479 return false; 1466 return false;
1480 1467
1481 if (CPDF_Number* pNo = ToNumber(pDict->GetObjectFor("P"))) 1468 if (CPDF_Number* pNo = ToNumber(pDict->GetObjectFor("P")))
1482 m_dwFirstPageNo = pNo->GetInteger(); 1469 m_dwFirstPageNo = pNo->GetInteger();
1483 1470
1484 if (CPDF_Number* pTable = ToNumber(pDict->GetObjectFor("T"))) 1471 if (CPDF_Number* pTable = ToNumber(pDict->GetObjectFor("T")))
1485 m_LastXRefOffset = pTable->GetInteger(); 1472 m_LastXRefOffset = pTable->GetInteger();
1486 1473
1487 return true; 1474 return true;
1488 } 1475 }
1489 m_pLinearized->Release(); 1476 delete m_pLinearized;
1490 m_pLinearized = nullptr; 1477 m_pLinearized = nullptr;
1491 return false; 1478 return false;
1492 } 1479 }
1493 1480
1494 CPDF_Parser::Error CPDF_Parser::StartLinearizedParse( 1481 CPDF_Parser::Error CPDF_Parser::StartLinearizedParse(
1495 IFX_SeekableReadStream* pFileAccess, 1482 IFX_SeekableReadStream* pFileAccess,
1496 CPDF_Document* pDocument) { 1483 CPDF_Document* pDocument) {
1497 ASSERT(!m_bHasParsed); 1484 ASSERT(!m_bHasParsed);
1498 1485
1499 m_bXRefStream = false; 1486 m_bXRefStream = false;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1588 return false; 1575 return false;
1589 } 1576 }
1590 m_ObjectStreamMap.clear(); 1577 m_ObjectStreamMap.clear();
1591 m_bXRefStream = true; 1578 m_bXRefStream = true;
1592 return true; 1579 return true;
1593 } 1580 }
1594 1581
1595 CPDF_Parser::Error CPDF_Parser::LoadLinearizedMainXRefTable() { 1582 CPDF_Parser::Error CPDF_Parser::LoadLinearizedMainXRefTable() {
1596 uint32_t dwSaveMetadataObjnum = m_pSyntax->m_MetadataObjnum; 1583 uint32_t dwSaveMetadataObjnum = m_pSyntax->m_MetadataObjnum;
1597 m_pSyntax->m_MetadataObjnum = 0; 1584 m_pSyntax->m_MetadataObjnum = 0;
1598 if (m_pTrailer) {
1599 m_pTrailer->Release();
1600 m_pTrailer = nullptr;
1601 }
1602 1585
1586 delete m_pTrailer;
1587 m_pTrailer = nullptr;
1603 m_pSyntax->RestorePos(m_LastXRefOffset - m_pSyntax->m_HeaderOffset); 1588 m_pSyntax->RestorePos(m_LastXRefOffset - m_pSyntax->m_HeaderOffset);
1589
1604 uint8_t ch = 0; 1590 uint8_t ch = 0;
1605 uint32_t dwCount = 0; 1591 uint32_t dwCount = 0;
1606 m_pSyntax->GetNextChar(ch); 1592 m_pSyntax->GetNextChar(ch);
1607 while (PDFCharIsWhitespace(ch)) { 1593 while (PDFCharIsWhitespace(ch)) {
1608 ++dwCount; 1594 ++dwCount;
1609 if (m_pSyntax->m_FileLen >= 1595 if (m_pSyntax->m_FileLen >=
1610 (FX_FILESIZE)(m_pSyntax->SavePos() + m_pSyntax->m_HeaderOffset)) { 1596 (FX_FILESIZE)(m_pSyntax->SavePos() + m_pSyntax->m_HeaderOffset)) {
1611 break; 1597 break;
1612 } 1598 }
1613 m_pSyntax->GetNextChar(ch); 1599 m_pSyntax->GetNextChar(ch);
1614 } 1600 }
1615 m_LastXRefOffset += dwCount; 1601 m_LastXRefOffset += dwCount;
1616 m_ObjectStreamMap.clear(); 1602 m_ObjectStreamMap.clear();
1617 m_ObjCache.clear(); 1603 m_ObjCache.clear();
1618 1604
1619 if (!LoadLinearizedAllCrossRefV4(m_LastXRefOffset, m_dwXrefStartObjNum) && 1605 if (!LoadLinearizedAllCrossRefV4(m_LastXRefOffset, m_dwXrefStartObjNum) &&
1620 !LoadLinearizedAllCrossRefV5(m_LastXRefOffset)) { 1606 !LoadLinearizedAllCrossRefV5(m_LastXRefOffset)) {
1621 m_LastXRefOffset = 0; 1607 m_LastXRefOffset = 0;
1622 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; 1608 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum;
1623 return FORMAT_ERROR; 1609 return FORMAT_ERROR;
1624 } 1610 }
1625 1611
1626 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; 1612 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum;
1627 return SUCCESS; 1613 return SUCCESS;
1628 } 1614 }
OLDNEW
« no previous file with comments | « core/fpdfapi/parser/cpdf_object_unittest.cpp ('k') | core/fpdfapi/parser/cpdf_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698