summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-04-23 21:49:11 +0200
committerGitHub <noreply@github.com>2021-04-23 21:49:11 +0200
commitb923726f67b9cf200c03725fcf70a4b2658ec015 (patch)
tree53248c18d99ee6b44f121a0f60c0af0279cdfc3a /platform
parentff6f38461879c1ce95e2ca9fea8ab9504557b24e (diff)
parenta09f3833bda5c1c695a137d2eb153aeb06141484 (diff)
Merge pull request #48141 from akien-mga/android-fileaccess-get_buffer-false-positive
Android: Fix get_buffer false positive on empty dest buffer
Diffstat (limited to 'platform')
-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);