diff options
author | Graeme Connell <gconnell@google.com> | 2017-02-06 10:52:35 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-06 20:11:27 +0000 |
commit | baf318f298af51bcf1e8719de703773e5e3b94ea (patch) | |
tree | 956acda0c29bd8d001a1e9f447e13ea6df63194a | |
parent | f9baca8709472f71fe0e5bcae95717b7f712b4a5 (diff) | |
download | pdfium-baf318f298af51bcf1e8719de703773e5e3b94ea.tar.xz |
Fix stream reading from pFile.
If m_pFile is set, m_bMemoryBased is set to false. However, ReadRawData
incorrectly checks if m_bMemoryBased is TRUE before passing a read to
m_pFile. This fix changes things to correctly call m_pFile's ReadBlock.
Filed associated https://bugs.chromium.org/p/pdfium/issues/detail?id=662
BUG=pdfium:662
Change-Id: If58af9093e3de78261a4cf1eb0460b7c7c153e5a
Reviewed-on: https://pdfium-review.googlesource.com/2532
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
-rw-r--r-- | core/fpdfapi/parser/cpdf_stream.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fpdfapi/parser/cpdf_stream.cpp b/core/fpdfapi/parser/cpdf_stream.cpp index e186bc19d1..d62b45641b 100644 --- a/core/fpdfapi/parser/cpdf_stream.cpp +++ b/core/fpdfapi/parser/cpdf_stream.cpp @@ -113,7 +113,7 @@ void CPDF_Stream::SetData(const uint8_t* pData, uint32_t size) { bool CPDF_Stream::ReadRawData(FX_FILESIZE offset, uint8_t* buf, uint32_t size) const { - if (m_bMemoryBased && m_pFile) + if (!m_bMemoryBased && m_pFile) return m_pFile->ReadBlock(buf, offset, size); if (m_pDataBuf) |