From 1f61f0c3de6d571885b32a22fe8146b4389a3252 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 20 Sep 2022 21:35:44 +0200 Subject: [PATCH] FIX: Caculate buffer end pointer after initing all attributes --- code/AssetLib/MD5/MD5Parser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/MD5/MD5Parser.cpp b/code/AssetLib/MD5/MD5Parser.cpp index 81c711713..e0a7da654 100644 --- a/code/AssetLib/MD5/MD5Parser.cpp +++ b/code/AssetLib/MD5/MD5Parser.cpp @@ -60,10 +60,11 @@ using namespace Assimp::MD5; // ------------------------------------------------------------------------------------------------ // Parse the segment structure for an MD5 file -MD5Parser::MD5Parser(char *_buffer, unsigned int _fileSize) : buffer(_buffer), bufferEnd(_buffer + fileSize), fileSize(_fileSize), lineNumber(0) { +MD5Parser::MD5Parser(char *_buffer, unsigned int _fileSize) : buffer(_buffer), bufferEnd(nullptr), fileSize(_fileSize), lineNumber(0) { ai_assert(nullptr != _buffer); ai_assert(0 != _fileSize); + bufferEnd = buffer + _fileSize; ASSIMP_LOG_DEBUG("MD5Parser begin"); // parse the file header