소스 검색

Fix FileAccessPack::get_buffer will update pos past the length of file

(cherry picked from commit 68a6fe81abadfac596d95234ecb34dfb01076f52)
jsjtxietian 1 년 전
부모
커밋
a47a07d13b
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      core/io/file_access_pack.cpp

+ 1 - 1
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;