소스 검색

Fix bug in glTF binary parser

Gary Hsu 5 년 전
부모
커밋
d63d2e0d99
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      loaders/src/glTF/glTFFileLoader.ts

+ 2 - 2
loaders/src/glTF/glTFFileLoader.ts

@@ -795,7 +795,7 @@ export class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISc
         }
 
         // Bail if there are no other chunks.
-        if (dataReader.byteOffset + chunkLength === dataReader.buffer.byteLength) {
+        if (dataReader.byteOffset + chunkLength === length) {
             return dataReader.loadAsync(chunkLength).then(() => {
                 return { json: this._parseJson(dataReader.readString(chunkLength)), bin: null };
             });
@@ -829,7 +829,7 @@ export class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISc
                     }
                 }
 
-                if (dataReader.byteOffset !== dataReader.buffer.byteLength) {
+                if (dataReader.byteOffset !== length) {
                     return dataReader.loadAsync(8).then(readAsync);
                 }