From 281c1913678f130ec04fb8ee5d49975efc12a01b Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 30 Dec 2018 10:44:43 +0100 Subject: [PATCH] fix streamreader::end definition for iterators. --- code/Importer/IFC/IFCLoader.cpp | 2 +- include/assimp/StreamReader.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/code/Importer/IFC/IFCLoader.cpp b/code/Importer/IFC/IFCLoader.cpp index 01cb39773..97c514d44 100644 --- a/code/Importer/IFC/IFCLoader.cpp +++ b/code/Importer/IFC/IFCLoader.cpp @@ -842,7 +842,7 @@ aiNode* ProcessSpatialStructure(aiNode* parent, const Schema_2x3::IfcProduct& el nd->mChildren = new aiNode*[subnodes.size()](); for(aiNode* nd2 : subnodes) { nd->mChildren[nd->mNumChildren++] = nd2; - nd2->mParent = nd.get(); + nd2->mParent = nd; } } } catch(...) { diff --git a/include/assimp/StreamReader.h b/include/assimp/StreamReader.h index b01ee4b66..4e5d2ddfa 100644 --- a/include/assimp/StreamReader.h +++ b/include/assimp/StreamReader.h @@ -48,11 +48,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_STREAMREADER_H_INCLUDED #define AI_STREAMREADER_H_INCLUDED +#include +#include + #include "ByteSwapper.h" #include "Exceptional.h" #include -#include -#include namespace Assimp { @@ -314,7 +315,7 @@ private: const size_t read = stream->Read(current,1,s); // (read < s) can only happen if the stream was opened in text mode, in which case FileSize() is not reliable ai_assert(read <= s); - end = limit = &buffer[read]; + end = limit = &buffer[read-1] + 1; } private: