diff options
Diffstat (limited to 'core/fxcrt/cfx_readonlymemorystream.cpp')
-rw-r--r-- | core/fxcrt/cfx_readonlymemorystream.cpp | 2 |
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; |