mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-27 14:17:37 +01:00
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.
This commit is contained in:
parent
e7611e5eab
commit
f95754186a
@ -2175,7 +2175,7 @@ PoolVector<uint8_t> _File::get_buffer(int64_t p_length) const {
|
|||||||
w.release();
|
w.release();
|
||||||
|
|
||||||
if (len < p_length) {
|
if (len < p_length) {
|
||||||
data.resize(p_length);
|
data.resize(len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
Loading…
Reference in New Issue
Block a user