From 83617790a1336e4faf7c891c62cbc4909eaf8aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gilles=20Roudi=C3=A8re?= Date: Tue, 15 Nov 2022 09:50:26 +0100 Subject: Fixes infinite loop in ResourceFormatText when having unexpected end of file --- scene/resources/resource_format_text.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scene') diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 85b538b1d9..98a4909599 100644 --- a/scene/resources/resource_format_text.cpp +++ b/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 p_f, List *p_d error_text = "Unexpected end of file"; _printerr(); error = ERR_FILE_CORRUPT; + return; } } } -- cgit v1.2.3