From dc325069fe0dc3e2a660c25ee73c43ea467effb5 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Wed, 17 Jan 2024 11:23:03 -0600 Subject: [PATCH] Fix crash in GLTFBufferView::load_buffer_view_data --- modules/gltf/structures/gltf_buffer_view.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/gltf/structures/gltf_buffer_view.cpp b/modules/gltf/structures/gltf_buffer_view.cpp index d40ed69915a7..8588de075236 100644 --- a/modules/gltf/structures/gltf_buffer_view.cpp +++ b/modules/gltf/structures/gltf_buffer_view.cpp @@ -94,6 +94,7 @@ void GLTFBufferView::set_indices(bool p_indices) { } Vector GLTFBufferView::load_buffer_view_data(const Ref p_state) const { + ERR_FAIL_COND_V(p_state.is_null(), Vector()); ERR_FAIL_COND_V_MSG(byte_stride > 0, Vector(), "Buffer views with byte stride are not yet supported by this method."); const TypedArray> &buffers = p_state->get_buffers(); ERR_FAIL_INDEX_V(buffer, buffers.size(), Vector());