From cc9edcb97323d757411036de6335b176c2f97e2c Mon Sep 17 00:00:00 2001 From: cutealien Date: Fri, 13 May 2022 14:20:41 +0000 Subject: [PATCH] CIrrMeshFileLoader::readMeshBuffer avoid accessing pointer before it's not 0 check. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6391 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/CIrrMeshFileLoader.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/Irrlicht/CIrrMeshFileLoader.cpp b/source/Irrlicht/CIrrMeshFileLoader.cpp index f92b2dc..e24d7a5 100644 --- a/source/Irrlicht/CIrrMeshFileLoader.cpp +++ b/source/Irrlicht/CIrrMeshFileLoader.cpp @@ -276,13 +276,13 @@ void CIrrMeshFileLoader::readIndices(io::IXMLReader* reader, int indexCount, IIn void CIrrMeshFileLoader::readMeshBuffer(io::IXMLReader* reader, int vertexCount, CDynamicMeshBuffer* sbuffer) { - core::stringc data = reader->getNodeData(); - const c8* p = &data[0]; - scene::IVertexBuffer& Vertices = sbuffer->getVertexBuffer(); - video::E_VERTEX_TYPE vType = Vertices.getType(); - if (sbuffer) { + core::stringc data = reader->getNodeData(); + const c8* p = &data[0]; + scene::IVertexBuffer& Vertices = sbuffer->getVertexBuffer(); + video::E_VERTEX_TYPE vType = Vertices.getType(); + for (int i=0; i