Chromium Code Reviews| 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 "core/fpdfapi/fpdf_parser/include/cpdf_data_avail.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_data_avail.h" |
| 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 | 102 |
| 103 // Item 12: The number of bits needed to represent the numerator of | 103 // Item 12: The number of bits needed to represent the numerator of |
| 104 // the fractional position for each shared object reference. For each | 104 // the fractional position for each shared object reference. For each |
| 105 // shared object referenced from a page, there is an indication of | 105 // shared object referenced from a page, there is an indication of |
| 106 // where in the page's content stream the object is first referenced. | 106 // where in the page's content stream the object is first referenced. |
| 107 uint32_t dwSharedNumeratorBits = hStream->GetBits(16); | 107 uint32_t dwSharedNumeratorBits = hStream->GetBits(16); |
| 108 | 108 |
| 109 // Item 13: Skip Item 13 which has 16 bits. | 109 // Item 13: Skip Item 13 which has 16 bits. |
| 110 hStream->SkipBits(16); | 110 hStream->SkipBits(16); |
| 111 | 111 |
| 112 if (dwSharedObjBits >= 40) | |
|
Tom Sepez
2016/08/12 15:29:12
nit: can we make this kMumbleSomethingBits add add
Lei Zhang
2016/08/13 02:47:14
Done.
| |
| 113 return FALSE; | |
| 114 | |
| 112 CPDF_Object* pPageNum = m_pLinearizedDict->GetDirectObjectBy("N"); | 115 CPDF_Object* pPageNum = m_pLinearizedDict->GetDirectObjectBy("N"); |
| 113 int nPages = pPageNum ? pPageNum->GetInteger() : 0; | 116 int nPages = pPageNum ? pPageNum->GetInteger() : 0; |
| 114 if (nPages < 1) | 117 if (nPages < 1) |
| 115 return FALSE; | 118 return FALSE; |
| 116 | 119 |
| 117 FX_SAFE_UINT32 required_bits = dwDeltaObjectsBits; | 120 FX_SAFE_UINT32 required_bits = dwDeltaObjectsBits; |
| 118 required_bits *= pdfium::base::checked_cast<uint32_t>(nPages); | 121 required_bits *= pdfium::base::checked_cast<uint32_t>(nPages); |
| 119 if (!CanReadFromBitStream(hStream, required_bits)) | 122 if (!CanReadFromBitStream(hStream, required_bits)) |
| 120 return FALSE; | 123 return FALSE; |
| 121 | 124 |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 479 CPDF_Array* pRange = m_pLinearizedDict->GetArrayBy("H"); | 482 CPDF_Array* pRange = m_pLinearizedDict->GetArrayBy("H"); |
| 480 if (!pRange) | 483 if (!pRange) |
| 481 return -1; | 484 return -1; |
| 482 | 485 |
| 483 CPDF_Object* pStreamLen = pRange->GetDirectObjectAt(1); | 486 CPDF_Object* pStreamLen = pRange->GetDirectObjectAt(1); |
| 484 if (!pStreamLen) | 487 if (!pStreamLen) |
| 485 return -1; | 488 return -1; |
| 486 | 489 |
| 487 return pStreamLen->GetInteger(); | 490 return pStreamLen->GetInteger(); |
| 488 } | 491 } |
| OLD | NEW |