Comparing version 2.1.0 to 2.1.1
@@ -365,3 +365,3 @@ /******/ (function(modules) { // webpackBootstrap | ||
var colorIndex = image.pixels[i]; | ||
var color = image.colorTable[colorIndex]; | ||
var color = image.colorTable[colorIndex] || [0, 0, 0]; | ||
patchData[pos] = color[0]; | ||
@@ -460,5 +460,14 @@ patchData[pos + 1] = color[1]; | ||
var chunks = []; | ||
var streamSize = stream.data.length; | ||
var total = 0; | ||
for (var size = (0, _uint.readByte)()(stream); size !== terminator; size = (0, _uint.readByte)()(stream)) { | ||
// catch corrupted files with no terminator | ||
if (stream.pos + size >= streamSize) { | ||
var availableSize = streamSize - stream.pos; | ||
chunks.push((0, _uint.readBytes)(availableSize)(stream)); | ||
total += availableSize; | ||
break; | ||
} | ||
chunks.push((0, _uint.readBytes)(size)(stream)); | ||
@@ -465,0 +474,0 @@ total += size; |
{ | ||
"name": "gifuct-js", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Easy to use efficient .GIF parsing in javascript", | ||
@@ -34,4 +34,4 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"js-binary-schema-parser": "^2.0.0" | ||
"js-binary-schema-parser": "^2.0.2" | ||
} | ||
} |
1501
3774931