summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_readonlymemorystream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/cfx_readonlymemorystream.cpp')
-rw-r--r--core/fxcrt/cfx_readonlymemorystream.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fxcrt/cfx_readonlymemorystream.cpp b/core/fxcrt/cfx_readonlymemorystream.cpp
index 0a1a53a456..7b6a4c244d 100644
--- a/core/fxcrt/cfx_readonlymemorystream.cpp
+++ b/core/fxcrt/cfx_readonlymemorystream.cpp
@@ -29,6 +29,7 @@ bool CFX_ReadOnlyMemoryStream::ReadBlock(void* buffer,
if (!pos.IsValid() || pos.ValueOrDie() > m_span.size())
return false;
- memcpy(buffer, &m_span[offset], size);
+ auto copy_span = m_span.subspan(offset, size);
+ memcpy(buffer, copy_span.data(), copy_span.size());
return true;
}