| 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/src/fpdfapi/fpdf_parser/cpdf_hint_tables.h" | 7 #include "core/src/fpdfapi/fpdf_parser/cpdf_hint_tables.h" |
| 8 | 8 |
| 9 #include "core/include/fxcrt/fx_safe_types.h" | 9 #include "core/include/fxcrt/fx_safe_types.h" |
| 10 #include "core/include/fpdfapi/cpdf_array.h" | 10 #include "core/include/fpdfapi/cpdf_array.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 if (nFirstPageObjNum < 0) | 260 if (nFirstPageObjNum < 0) |
| 261 return FALSE; | 261 return FALSE; |
| 262 | 262 |
| 263 FX_DWORD dwPrevObjLen = 0; | 263 FX_DWORD dwPrevObjLen = 0; |
| 264 FX_DWORD dwCurObjLen = 0; | 264 FX_DWORD dwCurObjLen = 0; |
| 265 FX_SAFE_DWORD required_bits = dwSharedObjTotal; | 265 FX_SAFE_DWORD required_bits = dwSharedObjTotal; |
| 266 required_bits *= dwDeltaGroupLen; | 266 required_bits *= dwDeltaGroupLen; |
| 267 if (!CanReadFromBitStream(hStream, required_bits)) | 267 if (!CanReadFromBitStream(hStream, required_bits)) |
| 268 return FALSE; | 268 return FALSE; |
| 269 | 269 |
| 270 for (int i = 0; i < dwSharedObjTotal; ++i) { | 270 for (FX_DWORD i = 0; i < dwSharedObjTotal; ++i) { |
| 271 dwPrevObjLen = dwCurObjLen; | 271 dwPrevObjLen = dwCurObjLen; |
| 272 FX_SAFE_DWORD safeObjLen = hStream->GetBits(dwDeltaGroupLen); | 272 FX_SAFE_DWORD safeObjLen = hStream->GetBits(dwDeltaGroupLen); |
| 273 safeObjLen += dwGroupLeastLen; | 273 safeObjLen += dwGroupLeastLen; |
| 274 if (!safeObjLen.IsValid()) | 274 if (!safeObjLen.IsValid()) |
| 275 return FALSE; | 275 return FALSE; |
| 276 | 276 |
| 277 dwCurObjLen = safeObjLen.ValueOrDie(); | 277 dwCurObjLen = safeObjLen.ValueOrDie(); |
| 278 if (i < m_nFirstPageSharedObjs) { | 278 if (i < m_nFirstPageSharedObjs) { |
| 279 m_dwSharedObjNumArray.Add(nFirstPageObjNum + i); | 279 m_dwSharedObjNumArray.Add(nFirstPageObjNum + i); |
| 280 if (i == 0) | 280 if (i == 0) |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 CPDF_Array* pRange = m_pLinearizedDict->GetArrayBy("H"); | 460 CPDF_Array* pRange = m_pLinearizedDict->GetArrayBy("H"); |
| 461 if (!pRange) | 461 if (!pRange) |
| 462 return -1; | 462 return -1; |
| 463 | 463 |
| 464 CPDF_Object* pStreamLen = pRange->GetElementValue(1); | 464 CPDF_Object* pStreamLen = pRange->GetElementValue(1); |
| 465 if (!pStreamLen) | 465 if (!pStreamLen) |
| 466 return -1; | 466 return -1; |
| 467 | 467 |
| 468 return pStreamLen->GetInteger(); | 468 return pStreamLen->GetInteger(); |
| 469 } | 469 } |
| OLD | NEW |