瀏覽代碼

fix streamreader::end definition for iterators.

Kim Kulling 6 年之前
父節點
當前提交
281c191367
共有 2 個文件被更改,包括 5 次插入4 次删除
  1. 1 1
      code/Importer/IFC/IFCLoader.cpp
  2. 4 3
      include/assimp/StreamReader.h

+ 1 - 1
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(...) {

+ 4 - 3
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 <assimp/IOStream.hpp>
+#include <assimp/Defines.h>
+
 #include "ByteSwapper.h"
 #include "Exceptional.h"
 #include <memory>
-#include <assimp/IOStream.hpp>
-#include <assimp/Defines.h>
 
 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: