From 5e16b108244e2d6c12bfbd39ec4716437ff2b6bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 23 Apr 2021 21:32:46 +0200 Subject: [PATCH] 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. (cherry picked from commit a09f3833bda5c1c695a137d2eb153aeb06141484) --- platform/android/file_access_android.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/android/file_access_android.cpp b/platform/android/file_access_android.cpp index 7396c5a108c..f6e131b6f01 100644 --- a/platform/android/file_access_android.cpp +++ b/platform/android/file_access_android.cpp @@ -125,7 +125,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);