Merge pull request #46669 from W4RH4WK/add-fail-check-variant-construct

Add missing ERR_FAIL_INDEX check to Variant::construct
This commit is contained in:
Rémi Verschelde 2021-03-04 20:35:39 +01:00 committed by GitHub
commit 86fba08427
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -773,6 +773,7 @@ void Variant::_unregister_variant_constructors() {
}
void Variant::construct(Variant::Type p_type, Variant &base, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
ERR_FAIL_INDEX(p_type, Variant::VARIANT_MAX);
uint32_t s = construct_data[p_type].size();
for (uint32_t i = 0; i < s; i++) {
int argc = construct_data[p_type][i].argument_count;