ensureBuffer can modify this.buffer, so read it after ensureBuffer

This commit is contained in:
Andreas Gal 2011-06-22 02:34:26 -04:00
parent e928f18736
commit 3f713de5fe

2
pdf.js
View File

@ -671,9 +671,9 @@ var PredictorStream = (function() {
var predictor = this.stream.getByte();
var rawBytes = this.stream.getBytes(rowBytes);
var buffer = this.buffer;
var bufferLength = this.bufferLength;
this.ensureBuffer(bufferLength + pixBytes);
var buffer = this.buffer;
var currentRow = buffer.subarray(bufferLength, bufferLength + rowBytes);
var prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength);