ソースを参照

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);
                 }