From 68a6fe81abadfac596d95234ecb34dfb01076f52 Mon Sep 17 00:00:00 2001 From: jsjtxietian Date: Sun, 10 Dec 2023 16:21:16 +0800 Subject: [PATCH] Fix FileAccessPack::get_buffer will update pos past the length of file --- core/io/file_access_pack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index 74c5c1c1910..265d9ef56cc 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -327,7 +327,7 @@ uint64_t FileAccessPack::get_buffer(uint8_t *p_dst, uint64_t p_length) const { to_read = (int64_t)pf.size - (int64_t)pos; } - pos += p_length; + pos += to_read; if (to_read <= 0) { return 0;