Merge pull request #4399 from fkaelberer/FixInfiniteLoop

Fixes infinite loop in DecodeStream_ensureBuffer()
This commit is contained in:
Yury Delendik 2014-03-06 07:11:27 -06:00
commit 33a9582584

View File

@ -118,11 +118,13 @@ var DecodeStream = (function DecodeStreamClosure() {
current = 0;
}
var size = 512;
while (size < requested)
size <<= 1;
while (size < requested) {
size *= 2;
}
var buffer2 = new Uint8Array(size);
for (var i = 0; i < current; ++i)
for (var i = 0; i < current; ++i) {
buffer2[i] = buffer[i];
}
return (this.buffer = buffer2);
},
getByte: function DecodeStream_getByte() {