summaryrefslogtreecommitdiff
path: root/indra/newview/gltf/buffer_util.h
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-05-30 17:37:51 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-05-31 01:21:19 +0300
commitbd7e79df36f8bf473bd6332eda7f1def5b9aaad7 (patch)
tree2ece12f48b696db89f21517f7222316d53610cfb /indra/newview/gltf/buffer_util.h
parent136149d1a196d2c0c15b9977937e64ccd26c1a49 (diff)
#4191 Crash opening a gltf model
Diffstat (limited to 'indra/newview/gltf/buffer_util.h')
-rw-r--r--indra/newview/gltf/buffer_util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/indra/newview/gltf/buffer_util.h b/indra/newview/gltf/buffer_util.h
index 2632a0f263..be36c5e90b 100644
--- a/indra/newview/gltf/buffer_util.h
+++ b/indra/newview/gltf/buffer_util.h
@@ -375,6 +375,11 @@ namespace LL
template<class T>
inline void copy(Asset& asset, Accessor& accessor, LLStrider<T>& dst)
{
+ if (accessor.mBufferView == INVALID_INDEX)
+ {
+ LL_WARNS("GLTF") << "Invalid buffer" << LL_ENDL;
+ return;
+ }
const BufferView& bufferView = asset.mBufferViews[accessor.mBufferView];
const Buffer& buffer = asset.mBuffers[bufferView.mBuffer];
const U8* src = buffer.mData.data() + bufferView.mByteOffset + accessor.mByteOffset;