Fix infinite loop in DecodeStream_ensureBuffer()

This commit is contained in:
fkaelberer 2014-03-06 10:31:18 +01:00
parent 7725e9cd77
commit 6755ea70b0

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() {