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/fpdf_parser/cpdf_hint_tables.h" | 7 #include "core/fpdfapi/fpdf_parser/cpdf_hint_tables.h" |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
11 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 11 #include "core/fpdfapi/fpdf_parser/cpdf_array.h" |
12 #include "core/fpdfapi/fpdf_parser/include/cpdf_data_avail.h" | 12 #include "core/fpdfapi/fpdf_parser/cpdf_data_avail.h" |
13 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" | 13 #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" |
14 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 14 #include "core/fpdfapi/fpdf_parser/cpdf_document.h" |
15 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" | 15 #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" |
16 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h" | 16 #include "core/fpdfapi/fpdf_parser/cpdf_stream_acc.h" |
17 #include "core/fxcrt/include/fx_safe_types.h" | 17 #include "core/fxcrt/include/fx_safe_types.h" |
18 #include "third_party/base/numerics/safe_conversions.h" | 18 #include "third_party/base/numerics/safe_conversions.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 bool CanReadFromBitStream(const CFX_BitStream* hStream, | 22 bool CanReadFromBitStream(const CFX_BitStream* hStream, |
23 const FX_SAFE_UINT32& bits) { | 23 const FX_SAFE_UINT32& bits) { |
24 return bits.IsValid() && hStream->BitsRemaining() >= bits.ValueOrDie(); | 24 return bits.IsValid() && hStream->BitsRemaining() >= bits.ValueOrDie(); |
25 } | 25 } |
26 | 26 |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 } | 515 } |
516 | 516 |
517 int CPDF_HintTables::ReadPrimaryHintStream(int index) const { | 517 int CPDF_HintTables::ReadPrimaryHintStream(int index) const { |
518 CPDF_Array* pRange = m_pLinearizedDict->GetArrayFor("H"); | 518 CPDF_Array* pRange = m_pLinearizedDict->GetArrayFor("H"); |
519 if (!pRange) | 519 if (!pRange) |
520 return -1; | 520 return -1; |
521 | 521 |
522 CPDF_Object* pStreamLen = pRange->GetDirectObjectAt(index); | 522 CPDF_Object* pStreamLen = pRange->GetDirectObjectAt(index); |
523 return pStreamLen ? pStreamLen->GetInteger() : -1; | 523 return pStreamLen ? pStreamLen->GetInteger() : -1; |
524 } | 524 } |
OLD | NEW |