Merge pull request #77266 from Rindbee/fix-bugs-in-TextureStorage-texture_3d_update

Fix calling `TextureStorage::texture_3d_update()` could cause a crash
This commit is contained in:
Rémi Verschelde 2023-05-22 13:49:23 +02:00
commit 1086375785
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1153,8 +1153,8 @@ void TextureStorage::texture_3d_update(RID p_texture, const Vector<Ref<Image>> &
image = image->duplicate();
image->convert(tex->validated_format);
}
all_data_size += images[i]->get_data().size();
images.push_back(image);
all_data_size += image->get_data().size();
images.write[i] = image;
}
all_data.resize(all_data_size); //consolidate all data here