Skip to content

Commit

Permalink
Merge pull request #88823 from jsjtxietian/limit-NoiseTexture3D
Browse files Browse the repository at this point in the history
Do overflow check in when generating NoiseTexture3D
  • Loading branch information
akien-mga committed Feb 27, 2024
2 parents 04e16a2 + 3d17aac commit bbe263d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/noise/noise_texture_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit bbe263d

Please sign in to comment.