| OLD | NEW |
| 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/page/cpdf_streamcontentparser.h" | 7 #include "core/fpdfapi/page/cpdf_streamcontentparser.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 } | 660 } |
| 661 ReplaceAbbr(pDict); | 661 ReplaceAbbr(pDict); |
| 662 CPDF_Object* pCSObj = nullptr; | 662 CPDF_Object* pCSObj = nullptr; |
| 663 if (pDict->KeyExist("ColorSpace")) { | 663 if (pDict->KeyExist("ColorSpace")) { |
| 664 pCSObj = pDict->GetDirectObjectFor("ColorSpace"); | 664 pCSObj = pDict->GetDirectObjectFor("ColorSpace"); |
| 665 if (pCSObj->IsName()) { | 665 if (pCSObj->IsName()) { |
| 666 CFX_ByteString name = pCSObj->GetString(); | 666 CFX_ByteString name = pCSObj->GetString(); |
| 667 if (name != "DeviceRGB" && name != "DeviceGray" && name != "DeviceCMYK") { | 667 if (name != "DeviceRGB" && name != "DeviceGray" && name != "DeviceCMYK") { |
| 668 pCSObj = FindResourceObj("ColorSpace", name); | 668 pCSObj = FindResourceObj("ColorSpace", name); |
| 669 if (pCSObj && pCSObj->IsInline()) { | 669 if (pCSObj && pCSObj->IsInline()) { |
| 670 pCSObj = pCSObj->Clone(); | 670 pCSObj = pCSObj->Clone().release(); |
| 671 pDict->SetFor("ColorSpace", pCSObj); | 671 pDict->SetFor("ColorSpace", pCSObj); |
| 672 } | 672 } |
| 673 } | 673 } |
| 674 } | 674 } |
| 675 } | 675 } |
| 676 pDict->SetNameFor("Subtype", "Image"); | 676 pDict->SetNameFor("Subtype", "Image"); |
| 677 std::unique_ptr<CPDF_Stream> pStream( | 677 std::unique_ptr<CPDF_Stream> pStream( |
| 678 m_pSyntax->ReadInlineStream(m_pDocument, pDict, pCSObj)); | 678 m_pSyntax->ReadInlineStream(m_pDocument, pDict, pCSObj)); |
| 679 bool bGaveDictAway = !!pStream; | 679 bool bGaveDictAway = !!pStream; |
| 680 while (1) { | 680 while (1) { |
| (...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1665 } | 1665 } |
| 1666 default: | 1666 default: |
| 1667 bProcessed = false; | 1667 bProcessed = false; |
| 1668 } | 1668 } |
| 1669 if (!bProcessed) { | 1669 if (!bProcessed) { |
| 1670 m_pSyntax->SetPos(last_pos); | 1670 m_pSyntax->SetPos(last_pos); |
| 1671 return; | 1671 return; |
| 1672 } | 1672 } |
| 1673 } | 1673 } |
| 1674 } | 1674 } |
| OLD | NEW |