You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
[Core] Fix File.get_buffer returning wrong length
File.get_buffer always returned as many bytes as requested (even when
EOF was reached), this resulted in random bytes being returned when
overflowing.
(cherry picked from commit d8ea68d3dd)
This commit is contained in:
committed by
Rémi Verschelde
parent
b59bf031a1
commit
c363d2d5b3
@@ -2082,7 +2082,7 @@ PoolVector<uint8_t> _File::get_buffer(int64_t p_length) const {
|
||||
w.release();
|
||||
|
||||
if (len < p_length) {
|
||||
data.resize(p_length);
|
||||
data.resize(len);
|
||||
}
|
||||
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user