From 30ca98d86ee4ec1113e2809e928ec5ed68ce5e48 Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 6 Sep 2024 15:49:06 +0100 Subject: [PATCH] fix: gltf buffer view incorrectly calculating stride --- src/ObjLoading/XModel/Gltf/Internal/GltfBufferView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ObjLoading/XModel/Gltf/Internal/GltfBufferView.cpp b/src/ObjLoading/XModel/Gltf/Internal/GltfBufferView.cpp index 0b87fecb..4a09da42 100644 --- a/src/ObjLoading/XModel/Gltf/Internal/GltfBufferView.cpp +++ b/src/ObjLoading/XModel/Gltf/Internal/GltfBufferView.cpp @@ -12,7 +12,7 @@ BufferView::BufferView(const Buffer* buffer, const size_t offset, const size_t l bool BufferView::ReadElement(void* dest, const size_t elementIndex, const size_t elementSize, const size_t elementOffset) const { - const auto stride = std::max(elementOffset + elementSize, m_stride); + const auto stride = std::max(elementSize, m_stride); const auto bufferViewOffset = elementOffset + elementIndex * stride; if (bufferViewOffset + elementSize > m_length) return false;