Skip to content

Commit 1a17fc9

Browse files
[Core] Fix FileAccessCompressed.get_buffer size error on multiples of block size
1 parent ef1153b commit 1a17fc9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/io/file_access_compressed.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,14 @@ uint64_t FileAccessCompressed::get_buffer(uint8_t *p_dst, uint64_t p_length) con
292292
ERR_FAIL_COND_V_MSG(ret == -1, -1, "Compressed file is corrupt.");
293293
read_block_size = read_block == read_block_count - 1 ? read_total % block_size : block_size;
294294
read_pos = 0;
295+
296+
if (read_block_size == 0) {
297+
at_end = true;
298+
if (i + 1 < p_length) {
299+
read_eof = true;
300+
}
301+
return i + 1;
302+
}
295303
}
296304

297305
return p_length;

0 commit comments

Comments
 (0)