mirror of
https://github.com/danbulant/pngjs
synced 2026-05-26 21:31:56 +00:00
Merge pull request #1 from steelsojka/maxstack-fix
fix(chunkstream): max call stack thrown when parsing large pngs
This commit is contained in:
commit
1415f9fe1a
1 changed files with 8 additions and 6 deletions
|
|
@ -48,14 +48,16 @@ ChunkStream.prototype.read = function(length, callback) {
|
|||
func: callback
|
||||
});
|
||||
|
||||
this._process();
|
||||
process.nextTick(function() {
|
||||
this._process();
|
||||
|
||||
// its paused and there is not enought data then ask for more
|
||||
if (this._paused && this._reads.length > 0) {
|
||||
this._paused = false;
|
||||
// its paused and there is not enought data then ask for more
|
||||
if (this._paused && this._reads.length > 0) {
|
||||
this._paused = false;
|
||||
|
||||
this.emit('drain');
|
||||
}
|
||||
this.emit('drain');
|
||||
}
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
ChunkStream.prototype.write = function(data, encoding) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue