summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_readonlymemorystream.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-14 18:26:36 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-14 18:26:36 +0000
commit88798cff29934b58e0a8d81e94005472d612b964 (patch)
tree3b5a25faa2a627ac30de219b89c8152a9fff2f27 /core/fxcrt/cfx_readonlymemorystream.cpp
parentb9c3e2712f75363372622282023143b86b72f2df (diff)
downloadpdfium-88798cff29934b58e0a8d81e94005472d612b964.tar.xz
Remove CFX_BufferSeekableReadStream.
Replace it with CFX_ReadOnlyMemoryStream, which does the same thing. Take some checks from CFX_BufferSeekableReadStream and add them CFX_ReadOnlyMemoryStream. Change-Id: I25554c3aec3ec96967f8df16ca68a64dba121b6f Reviewed-on: https://pdfium-review.googlesource.com/40070 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcrt/cfx_readonlymemorystream.cpp')
-rw-r--r--core/fxcrt/cfx_readonlymemorystream.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fxcrt/cfx_readonlymemorystream.cpp b/core/fxcrt/cfx_readonlymemorystream.cpp
index a01ed2e474..0a1a53a456 100644
--- a/core/fxcrt/cfx_readonlymemorystream.cpp
+++ b/core/fxcrt/cfx_readonlymemorystream.cpp
@@ -21,7 +21,7 @@ FX_FILESIZE CFX_ReadOnlyMemoryStream::GetSize() {
bool CFX_ReadOnlyMemoryStream::ReadBlock(void* buffer,
FX_FILESIZE offset,
size_t size) {
- if (offset < 0)
+ if (!buffer || offset < 0 || size == 0)
return false;
FX_SAFE_SIZE_T pos = size;