diff options
Diffstat (limited to 'source/core')
| -rw-r--r-- | source/core/slang-stream.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/core/slang-stream.h b/source/core/slang-stream.h index 9f405dbb0..a62c18838 100644 --- a/source/core/slang-stream.h +++ b/source/core/slang-stream.h @@ -138,7 +138,10 @@ public: void setContent(const void* contents, size_t contentsSize) { m_ownedContents.setCount(contentsSize); - ::memcpy(m_ownedContents.getBuffer(), contents, contentsSize); + if (contentsSize > 0) + { + ::memcpy(m_ownedContents.getBuffer(), contents, contentsSize); + } _setContents(m_ownedContents.getBuffer(), m_ownedContents.getCount()); } |
