From baf318f298af51bcf1e8719de703773e5e3b94ea Mon Sep 17 00:00:00 2001 From: Graeme Connell Date: Mon, 6 Feb 2017 10:52:35 -0700 Subject: 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 Commit-Queue: Tom Sepez --- core/fpdfapi/parser/cpdf_stream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') 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) -- cgit v1.2.3