diff options
Diffstat (limited to 'drivers/gles3/shader_gles3.h')
-rw-r--r-- | drivers/gles3/shader_gles3.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gles3/shader_gles3.h b/drivers/gles3/shader_gles3.h index 35fb202342..228bed6f9b 100644 --- a/drivers/gles3/shader_gles3.h +++ b/drivers/gles3/shader_gles3.h @@ -219,7 +219,10 @@ protected: Version *version = version_owner.get_or_null(p_version); ERR_FAIL_COND_V(!version, -1); ERR_FAIL_INDEX_V(p_variant, int(version->variants.size()), -1); - return version->variants[p_variant].lookup_ptr(p_specialization)->uniform_location[p_which]; + Version::Specialization *spec = version->variants[p_variant].lookup_ptr(p_specialization); + ERR_FAIL_COND_V(!spec, -1); + ERR_FAIL_INDEX_V(p_which, int(spec->uniform_location.size()), -1); + return spec->uniform_location[p_which]; } virtual void _init() = 0; |