Commit 761013fe authored by nanahira's avatar nanahira

fix

parent 0a0756a4
......@@ -122,9 +122,10 @@ class Replay
@fromBuffer: (buffer) ->
reader = new ReplayReader buffer
header = Replay.readHeader reader
lzmaBuffer = Buffer.concat [header.getLzmaHeader(), reader.readAll()]
restBuffer = reader.readAll()
lzmaBuffer = Buffer.concat [header.getLzmaHeader(), restBuffer]
if header.isCompressed
decompressed = lzmaBuffer
decompressed = restBuffer
else
decompressed = Buffer.from lzma.decompress lzmaBuffer
reader = new ReplayReader decompressed
......
......@@ -180,12 +180,13 @@
}
static fromBuffer(buffer) {
var decompressed, header, lzmaBuffer, reader, replay;
var decompressed, header, lzmaBuffer, reader, replay, restBuffer;
reader = new ReplayReader(buffer);
header = Replay.readHeader(reader);
lzmaBuffer = Buffer.concat([header.getLzmaHeader(), reader.readAll()]);
restBuffer = reader.readAll();
lzmaBuffer = Buffer.concat([header.getLzmaHeader(), restBuffer]);
if (header.isCompressed) {
decompressed = lzmaBuffer;
decompressed = restBuffer;
} else {
decompressed = Buffer.from(lzma.decompress(lzmaBuffer));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment