浏览代码

Fix `_File::get_buffer` length always set to p_length

Johannes 4 年之前
父节点
当前提交
33d6eccdec
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/core_bind.cpp

+ 1 - 1
core/core_bind.cpp

@@ -1334,7 +1334,7 @@ Vector<uint8_t> _File::get_buffer(int p_length) const {
 	ERR_FAIL_COND_V(len < 0, Vector<uint8_t>());
 
 	if (len < p_length) {
-		data.resize(p_length);
+		data.resize(len);
 	}
 
 	return data;