VariantParser: Fix uninitialized ResourceParser funcs
They could cause a segfault when parsing values with ID "Resource" as apparently we never set a valid `func` for it. Fixes crash part of #42115.
This commit is contained in:
parent
5a30ba7a66
commit
f3aaa713d9
2 changed files with 3 additions and 4 deletions
|
@ -73,9 +73,9 @@ public:
|
|||
|
||||
struct ResourceParser {
|
||||
void *userdata = nullptr;
|
||||
ParseResourceFunc func;
|
||||
ParseResourceFunc ext_func;
|
||||
ParseResourceFunc sub_func;
|
||||
ParseResourceFunc func = nullptr;
|
||||
ParseResourceFunc ext_func = nullptr;
|
||||
ParseResourceFunc sub_func = nullptr;
|
||||
};
|
||||
|
||||
enum TokenType {
|
||||
|
|
|
@ -982,7 +982,6 @@ void ResourceLoaderText::open(FileAccess *p_f, bool p_skip_first_tag) {
|
|||
|
||||
rp.ext_func = _parse_ext_resources;
|
||||
rp.sub_func = _parse_sub_resources;
|
||||
rp.func = nullptr;
|
||||
rp.userdata = this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue