summaryrefslogtreecommitdiff
path: root/platform/android/file_access_android.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-04-23 21:32:46 +0200
committerRémi Verschelde <rverschelde@gmail.com>2021-04-23 21:33:13 +0200
commita09f3833bda5c1c695a137d2eb153aeb06141484 (patch)
tree53248c18d99ee6b44f121a0f60c0af0279cdfc3a /platform/android/file_access_android.cpp
parentff6f38461879c1ce95e2ca9fea8ab9504557b24e (diff)
Android: Fix get_buffer false positive on empty dest buffer
Follow-up to #46810, this was missed in #47079 when fixing the issue for other platforms. Fixes #48135.
Diffstat (limited to 'platform/android/file_access_android.cpp')
-rw-r--r--platform/android/file_access_android.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/android/file_access_android.cpp b/platform/android/file_access_android.cpp
index e288c16777..705891713f 100644
--- a/platform/android/file_access_android.cpp
+++ b/platform/android/file_access_android.cpp
@@ -114,7 +114,7 @@ uint8_t FileAccessAndroid::get_8() const {
}
int FileAccessAndroid::get_buffer(uint8_t *p_dst, int p_length) const {
- ERR_FAIL_COND_V(!p_dst, -1);
+ ERR_FAIL_COND_V(!p_dst && p_length > 0, -1);
ERR_FAIL_COND_V(p_length < 0, -1);
off_t r = AAsset_read(a, p_dst, p_length);