From c0ce45cfa3f44d18fb3800e7aa8b9506590f2d84 Mon Sep 17 00:00:00 2001 From: Mike Kruk Date: Wed, 2 May 2018 19:39:56 -0400 Subject: [PATCH] Update Base64Decode.js The array length should be 1/4 the size of the raw binary string, otherwise you end up with a bunch of undefined array values at the end. --- src/tilemaps/parsers/tiled/Base64Decode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tilemaps/parsers/tiled/Base64Decode.js b/src/tilemaps/parsers/tiled/Base64Decode.js index 06ae1b108..76e11ae14 100644 --- a/src/tilemaps/parsers/tiled/Base64Decode.js +++ b/src/tilemaps/parsers/tiled/Base64Decode.js @@ -18,7 +18,7 @@ var Base64Decode = function (data) { var binaryString = window.atob(data); var len = binaryString.length; - var bytes = new Array(len); + var bytes = new Array(len / 4); // Interpret binaryString as an array of bytes representing little-endian encoded uint32 values. for (var i = 0; i < len; i += 4)