浏览代码

Ensure FileAccessBuffered structs are properly initialized

Andy Maloney 5 年之前
父节点
当前提交
37a2a5a997
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      core/io/file_access_buffered.h

+ 5 - 5
core/io/file_access_buffered.h

@@ -51,16 +51,16 @@ protected:
 	Error set_error(Error p_error) const;
 
 	mutable struct File {
-		bool open;
-		int size;
-		int offset;
+		bool open = false;
+		int size = 0;
+		int offset = 0;
 		String name;
-		int access_flags;
+		int access_flags = 0;
 	} file;
 
 	mutable struct Cache {
 		Vector<uint8_t> buffer;
-		int offset;
+		int offset = 0;
 	} cache;
 
 	virtual int read_data_block(int p_offset, int p_size, uint8_t *p_dest = nullptr) const = 0;