summaryrefslogtreecommitdiffstats
path: root/modules/gltf/structures/gltf_buffer_view.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2024-01-17 11:23:03 -0600
committerAaron Franke <arnfranke@yahoo.com>2024-01-17 20:57:31 -0600
commitdc325069fe0dc3e2a660c25ee73c43ea467effb5 (patch)
tree40f5762583539249460edaa778e07e169f302cd1 /modules/gltf/structures/gltf_buffer_view.cpp
parent96296e476ffda2d4c36680b2271e9eeff0c3b9f8 (diff)
downloadredot-engine-dc325069fe0dc3e2a660c25ee73c43ea467effb5.tar.gz
Fix crash in GLTFBufferView::load_buffer_view_data
Diffstat (limited to 'modules/gltf/structures/gltf_buffer_view.cpp')
-rw-r--r--modules/gltf/structures/gltf_buffer_view.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/gltf/structures/gltf_buffer_view.cpp b/modules/gltf/structures/gltf_buffer_view.cpp
index d40ed69915..8588de0752 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<uint8_t> GLTFBufferView::load_buffer_view_data(const Ref<GLTFState> p_state) const {
+ ERR_FAIL_COND_V(p_state.is_null(), Vector<uint8_t>());
ERR_FAIL_COND_V_MSG(byte_stride > 0, Vector<uint8_t>(), "Buffer views with byte stride are not yet supported by this method.");
const TypedArray<Vector<uint8_t>> &buffers = p_state->get_buffers();
ERR_FAIL_INDEX_V(buffer, buffers.size(), Vector<uint8_t>());