From b4437cbaa6a293f9b92e64f934d17f6798418368 Mon Sep 17 00:00:00 2001 From: dzil123 <5725958+dzil123@users.noreply.github.com> Date: Tue, 22 Nov 2022 01:44:19 -0800 Subject: Fix various missing rendering parameter checks --- drivers/gles3/storage/mesh_storage.cpp | 2 ++ drivers/gles3/storage/texture_storage.cpp | 1 + 2 files changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/gles3/storage/mesh_storage.cpp b/drivers/gles3/storage/mesh_storage.cpp index a47df42500..1f169dfff7 100644 --- a/drivers/gles3/storage/mesh_storage.cpp +++ b/drivers/gles3/storage/mesh_storage.cpp @@ -1352,6 +1352,8 @@ void MeshStorage::multimesh_set_buffer(RID p_multimesh, const Vector &p_b uint32_t old_stride = multimesh->xform_format == RS::MULTIMESH_TRANSFORM_2D ? 8 : 12; old_stride += multimesh->uses_colors ? 4 : 0; old_stride += multimesh->uses_custom_data ? 4 : 0; + ERR_FAIL_COND(p_buffer.size() != (multimesh->instances * (int)old_stride)); + for (int i = 0; i < multimesh->instances; i++) { { float *dataptr = w + i * old_stride; diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp index 15743c2d78..2f17ec460c 100644 --- a/drivers/gles3/storage/texture_storage.cpp +++ b/drivers/gles3/storage/texture_storage.cpp @@ -723,6 +723,7 @@ void TextureStorage::texture_2d_update(RID p_texture, const Ref &p_image, texture_set_data(p_texture, p_image, p_layer); #ifdef TOOLS_ENABLED Texture *tex = texture_owner.get_or_null(p_texture); + ERR_FAIL_COND(!tex); tex->image_cache_2d.unref(); #endif -- cgit v1.2.3