summaryrefslogtreecommitdiffstats
path: root/core/io/file_access_memory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/file_access_memory.cpp')
-rw-r--r--core/io/file_access_memory.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/io/file_access_memory.cpp b/core/io/file_access_memory.cpp
index 04270de77f..4bab8c1d3d 100644
--- a/core/io/file_access_memory.cpp
+++ b/core/io/file_access_memory.cpp
@@ -138,6 +138,8 @@ uint8_t FileAccessMemory::get_8() const {
}
int FileAccessMemory::get_buffer(uint8_t *p_dst, int p_length) const {
+ ERR_FAIL_COND_V(!p_dst, -1);
+ ERR_FAIL_COND_V(p_length < 0, -1);
ERR_FAIL_COND_V(!data, -1);
int left = length - pos;