| 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 "core/fpdfapi/fpdf_page/pageint.h" | 7 #include "core/fpdfapi/fpdf_page/pageint.h" |
| 8 | 8 |
| 9 #include <limits.h> | 9 #include <limits.h> |
| 10 | 10 |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 m_InternalStage = STAGE_PARSE; | 790 m_InternalStage = STAGE_PARSE; |
| 791 m_CurrentOffset = 0; | 791 m_CurrentOffset = 0; |
| 792 } | 792 } |
| 793 | 793 |
| 794 void CPDF_ContentParser::Continue(IFX_Pause* pPause) { | 794 void CPDF_ContentParser::Continue(IFX_Pause* pPause) { |
| 795 int steps = 0; | 795 int steps = 0; |
| 796 while (m_Status == ToBeContinued) { | 796 while (m_Status == ToBeContinued) { |
| 797 if (m_InternalStage == STAGE_GETCONTENT) { | 797 if (m_InternalStage == STAGE_GETCONTENT) { |
| 798 if (m_CurrentOffset == m_nStreams) { | 798 if (m_CurrentOffset == m_nStreams) { |
| 799 if (!m_StreamArray.empty()) { | 799 if (!m_StreamArray.empty()) { |
| 800 FX_SAFE_DWORD safeSize = 0; | 800 FX_SAFE_UINT32 safeSize = 0; |
| 801 for (const auto& stream : m_StreamArray) { | 801 for (const auto& stream : m_StreamArray) { |
| 802 safeSize += stream->GetSize(); | 802 safeSize += stream->GetSize(); |
| 803 safeSize += 1; | 803 safeSize += 1; |
| 804 } | 804 } |
| 805 if (!safeSize.IsValid()) { | 805 if (!safeSize.IsValid()) { |
| 806 m_Status = Done; | 806 m_Status = Done; |
| 807 return; | 807 return; |
| 808 } | 808 } |
| 809 m_Size = safeSize.ValueOrDie(); | 809 m_Size = safeSize.ValueOrDie(); |
| 810 m_pData = FX_Alloc(uint8_t, m_Size); | 810 m_pData = FX_Alloc(uint8_t, m_Size); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 } | 885 } |
| 886 m_Status = Done; | 886 m_Status = Done; |
| 887 return; | 887 return; |
| 888 } | 888 } |
| 889 steps++; | 889 steps++; |
| 890 if (pPause && pPause->NeedToPauseNow()) { | 890 if (pPause && pPause->NeedToPauseNow()) { |
| 891 break; | 891 break; |
| 892 } | 892 } |
| 893 } | 893 } |
| 894 } | 894 } |
| OLD | NEW |