Pārlūkot izejas kodu

Update protobuf.js

Lutz Roeder 1 gadu atpakaļ
vecāks
revīzija
61c4260ea5
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      source/protobuf.js

+ 2 - 1
source/protobuf.js

@@ -632,7 +632,8 @@ protobuf.StreamReader = class extends protobuf.BinaryReader {
         if (!this._buffer || this._position < this._offset || this._position + length > this._offset + this._buffer.length) {
             this._offset = this._position;
             this._stream.seek(this._offset);
-            this._buffer = this._stream.read(Math.min(0x10000000, this._length - this._offset));
+            const size = Math.min(0x10000000, this._length - this._offset);
+            this._buffer = this._stream.read(size);
             this._view = new DataView(this._buffer.buffer, this._buffer.byteOffset, this._buffer.byteLength);
         }
         const position = this._position;