Mark Sibly 7 ani în urmă
părinte
comite
445148ee2e
1 a modificat fișierele cu 4 adăugiri și 3 ștergeri
  1. 4 3
      modules/mojo3d/loader/gltf2loader.monkey2

+ 4 - 3
modules/mojo3d/loader/gltf2loader.monkey2

@@ -696,7 +696,7 @@ Class Gltf2Mojo3dLoader Extends Mojo3dLoader
 				Local version:=stream.ReadUInt()
 				Local version:=stream.ReadUInt()
 				Local length:=stream.ReadUInt()-12
 				Local length:=stream.ReadUInt()-12
 				
 				
-				While length>0 And Not stream.Eof
+				While length>=8 And Not stream.Eof
 					
 					
 					Local clength:=stream.ReadUInt()
 					Local clength:=stream.ReadUInt()
 					Local ctype:=stream.ReadUInt()
 					Local ctype:=stream.ReadUInt()
@@ -710,8 +710,9 @@ Class Gltf2Mojo3dLoader Extends Mojo3dLoader
 					Case $004E4942		'"BIN"
 					Case $004E4942		'"BIN"
 						bindata=stream.ReadAll( clength )
 						bindata=stream.ReadAll( clength )
 						If bindata.Length<>clength Exit 'FAIL!
 						If bindata.Length<>clength Exit 'FAIL!
-					Default
-						'NOP
+					Default				'?????
+						Local data:=stream.ReadAll( clength )
+						If data.Length<>clength Exit
 					End
 					End
 					
 					
 					length-=clength+8
 					length-=clength+8