Browse Source

[js] use src.b.byteLength to check if Bytes can use set for blitting (#5499)

vroad 9 years ago
parent
commit
f36d62d619
1 changed files with 1 additions and 1 deletions
  1. 1 1
      std/js/_std/haxe/io/Bytes.hx

+ 1 - 1
std/js/_std/haxe/io/Bytes.hx

@@ -53,7 +53,7 @@ class Bytes {
 
 	public function blit( pos : Int, src : Bytes, srcpos : Int, len : Int ) : Void {
 		if( pos < 0 || srcpos < 0 || len < 0 || pos + len > length || srcpos + len > src.length ) throw Error.OutsideBounds;
-		if( srcpos == 0 && len == src.length )
+		if( srcpos == 0 && len == src.b.byteLength )
 			b.set(src.b,pos);
 		else
 			b.set(src.b.subarray(srcpos,srcpos+len),pos);