From dc06efc1f3fcea7ee138d13537f4192593b0c29e Mon Sep 17 00:00:00 2001 From: Jordan Cristiano Date: Fri, 15 May 2015 00:54:05 -0400 Subject: [PATCH] Fixed incorrect packet buffer sizes --- demboyz/demreader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/demboyz/demreader.cpp b/demboyz/demreader.cpp index 7bcb049..70db6c3 100644 --- a/demboyz/demreader.cpp +++ b/demboyz/demreader.cpp @@ -118,6 +118,7 @@ void DemoReader::ProcessDem(void* inputFp, IDemoWriter* writer) do { + size_t rawDataSize = 0; reader.ReadCmdHeader(packet.cmd, packet.tick); switch (packet.cmd) { @@ -126,7 +127,7 @@ void DemoReader::ProcessDem(void* inputFp, IDemoWriter* writer) reader.ReadCmdInfo(*packet.cmdInfo); reader.ReadSequenceInfo(packet.sequenceInfo1, packet.sequenceInfo2); assert(packet.sequenceInfo1 == packet.sequenceInfo2); - reader.ReadRawData(buffer.data(), buffer.size()); + rawDataSize = reader.ReadRawData(buffer.data(), buffer.size()); break; case dem_synctick: // nothing @@ -157,7 +158,7 @@ void DemoReader::ProcessDem(void* inputFp, IDemoWriter* writer) writer->StartCommandPacket(packet); if (packet.cmd == dem_packet || packet.cmd == dem_signon) { - ParsePacket(buffer.data(), buffer.size(), context, writer); + ParsePacket(buffer.data(), rawDataSize, context, writer); } writer->EndCommandPacket(); } while (packet.cmd != dem_stop);