mirror of
https://github.com/danbulant/pngjs
synced 2026-07-09 05:00:39 +00:00
fix(chunkstream): max call stack thrown when parsing large pngs
This commit is contained in:
parent
82dd9a96c0
commit
df84165ca3
1 changed files with 8 additions and 6 deletions
|
|
@ -48,6 +48,7 @@ ChunkStream.prototype.read = function(length, callback) {
|
||||||
func: callback
|
func: callback
|
||||||
});
|
});
|
||||||
|
|
||||||
|
process.nextTick(function() {
|
||||||
this._process();
|
this._process();
|
||||||
|
|
||||||
// its paused and there is not enought data then ask for more
|
// its paused and there is not enought data then ask for more
|
||||||
|
|
@ -56,6 +57,7 @@ ChunkStream.prototype.read = function(length, callback) {
|
||||||
|
|
||||||
this.emit('drain');
|
this.emit('drain');
|
||||||
}
|
}
|
||||||
|
}.bind(this));
|
||||||
};
|
};
|
||||||
|
|
||||||
ChunkStream.prototype.write = function(data, encoding) {
|
ChunkStream.prototype.write = function(data, encoding) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue