From 53894390dba2ec571bab75157ebe60d11171ed07 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 9 Apr 2018 18:30:24 +0000 Subject: Use pdfium::span<> in CFX_BitStream, CPDF_SimpleParser. Get bounds checks in parsers automatically when using spans. Change-Id: I71fbe7b838435d455376db2f89817d807a9cdcfd Reviewed-on: https://pdfium-review.googlesource.com/29830 Commit-Queue: Tom Sepez Reviewed-by: dsinclair --- core/fpdfapi/parser/cpdf_hint_tables.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/fpdfapi/parser/cpdf_hint_tables.cpp') diff --git a/core/fpdfapi/parser/cpdf_hint_tables.cpp b/core/fpdfapi/parser/cpdf_hint_tables.cpp index 381b160233..123e6594c1 100644 --- a/core/fpdfapi/parser/cpdf_hint_tables.cpp +++ b/core/fpdfapi/parser/cpdf_hint_tables.cpp @@ -19,6 +19,7 @@ #include "core/fxcrt/cfx_bitstream.h" #include "core/fxcrt/fx_safe_types.h" #include "third_party/base/numerics/safe_conversions.h" +#include "third_party/base/span.h" namespace { @@ -488,7 +489,7 @@ bool CPDF_HintTables::LoadHintStream(CPDF_Stream* pHintStream) { return false; } - CFX_BitStream bs(pAcc->GetData(), size); + CFX_BitStream bs(pdfium::make_span(pAcc->GetData(), size)); return ReadPageHintTable(&bs) && ReadSharedObjHintTable(&bs, shared_hint_table_offset); } -- cgit v1.2.3