浏览代码

Merge pull request #68681 from groud/fix_infinite_loop_in_resource_loader

Fixes infinite loop in ResourceFormatText when having unexpected end of file
Rémi Verschelde 2 年之前
父节点
当前提交
7fda64a849
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      scene/resources/resource_format_text.cpp

+ 2 - 0
scene/resources/resource_format_text.cpp

@@ -511,6 +511,7 @@ Error ResourceLoaderText::load() {
 
 		if (error) {
 			_printerr();
+			return error;
 		}
 
 		resource_current++;
@@ -884,6 +885,7 @@ void ResourceLoaderText::get_dependencies(Ref<FileAccess> p_f, List<String> *p_d
 			error_text = "Unexpected end of file";
 			_printerr();
 			error = ERR_FILE_CORRUPT;
+			return;
 		}
 	}
 }