diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-04-17 23:46:18 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-17 23:46:18 +0000 |
commit | 51a41ea222eeb852be4f372165d2d9bc9094b2a4 (patch) | |
tree | 3fb5a449bc07b4fb5dde81af62836d6bfdf2a48f /core/fpdfapi | |
parent | 11e5882fbb03bec43956ae0ea4a2a5d9593ccb34 (diff) | |
download | pdfium-51a41ea222eeb852be4f372165d2d9bc9094b2a4.tar.xz |
Use span<> in GetBits32().
Get bounds checking "for free".
Change-Id: Ic60d63836f6c223e2ee1262649d47da54bb30ecc
Reviewed-on: https://pdfium-review.googlesource.com/30876
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r-- | core/fpdfapi/page/cpdf_sampledfunc.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fpdfapi/page/cpdf_sampledfunc.cpp b/core/fpdfapi/page/cpdf_sampledfunc.cpp index 205ce91eaa..cdedc862bb 100644 --- a/core/fpdfapi/page/cpdf_sampledfunc.cpp +++ b/core/fpdfapi/page/cpdf_sampledfunc.cpp @@ -125,8 +125,8 @@ bool CPDF_SampledFunc::v_Call(const float* inputs, float* results) const { if (!range_check.IsValid()) return false; - const uint8_t* pSampleData = m_pSampleStream->GetData(); - if (!pSampleData) + pdfium::span<const uint8_t> pSampleData = m_pSampleStream->GetSpan(); + if (pSampleData.empty()) return false; for (uint32_t j = 0; j < m_nOutputs; j++, bitpos += m_nBitsPerSample) { |