From d14956d4b8bf148f730fc9ee96becbde7a22d1a2 Mon Sep 17 00:00:00 2001 From: Apoorv Mishra <apoorvmishra101092@gmail.com> Date: Wed, 19 Jul 2017 05:24:33 +0530 Subject: [PATCH] Fix TypeError that occurs in colorspace.js on accidentally passing an 'Array' instead of 'TypedArray' Fix TypeError that occurs in colorspace.js on accidentally passing an 'Array' instead of 'TypedArray' Changed getRgbItem(...) to getRgbBuffer(...) since this.lookup has values in range[0, 255] whereas getRgbItem(...) expects those to be in range [0, 1] Revert changes for IE9 compatibility --- src/core/colorspace.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/colorspace.js b/src/core/colorspace.js index 979e44c6a..154f288b1 100644 --- a/src/core/colorspace.js +++ b/src/core/colorspace.js @@ -538,7 +538,7 @@ var IndexedCS = (function IndexedCSClosure() { dest, destOffset) { var numComps = this.base.numComps; var start = src[srcOffset] * numComps; - this.base.getRgbItem(this.lookup, start, dest, destOffset); + this.base.getRgbBuffer(this.lookup, start, 1, dest, destOffset, 8, 0); }, getRgbBuffer: function IndexedCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits,