提交 6eb1c2ea 编写于 作者: L Lewy Blue

Added nullByte check to getString

上级 85e22951
......@@ -3650,25 +3650,11 @@
getString: function ( size ) {
var a = [];
while ( size > 0 ) {
var value = this.getUint8();
size --;
if ( value === 0 ) {
this.skip( size );
break;
}
a.push( value );
}
var a = new Uint8Array( this.getUint8Array( size ) );
var nullByte = a.indexOf( 0 );
if ( nullByte >= 0 ) a = a.slice( 0, nullByte );
return THREE.LoaderUtils.decodeText( new Uint8Array( a ) );
return THREE.LoaderUtils.decodeText( a );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册