Merge pull request #88823 from jsjtxietian/limit-NoiseTexture3D

Do overflow check in when generating NoiseTexture3D
This commit is contained in:
Rémi Verschelde 2024-02-27 10:18:09 +01:00
commit bbe263d329
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -142,6 +142,8 @@ TypedArray<Image> NoiseTexture3D::_generate_texture() {
return TypedArray<Image>();
}
ERR_FAIL_COND_V_MSG((int64_t)width * height * depth > Image::MAX_PIXELS, TypedArray<Image>(), "The NoiseTexture3D is too big, consider lowering its width, height, or depth.");
Vector<Ref<Image>> images;
if (seamless) {