From b743566339ca0223d412cb7fd71344cb9496df98 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 15 Jul 2017 15:19:03 -0400 Subject: [PATCH] Corrected under-request of data: was erroneously supplying the size of input as the expected size of output. --- Storage/Tape/Formats/CSW.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Storage/Tape/Formats/CSW.cpp b/Storage/Tape/Formats/CSW.cpp index 1c1f73184..2a065cb03 100644 --- a/Storage/Tape/Formats/CSW.cpp +++ b/Storage/Tape/Formats/CSW.cpp @@ -66,8 +66,9 @@ CSW::CSW(const char *file_name) : file_data.resize(remaining_data); fread(file_data.data(), sizeof(uint8_t), remaining_data, file_); - uLongf output_length = (uLongf)remaining_data; + uLongf output_length = (uLongf)number_of_waves; uncompress(source_data_.data(), &output_length, file_data.data(), file_data.size()); + source_data_.resize((size_t)output_length); } else { rle_start_ = ftell(file_); }