1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-23 03:32:32 +00:00

Corrected under-request of data: was erroneously supplying the size of input as the expected size of output.

This commit is contained in:
Thomas Harte 2017-07-15 15:19:03 -04:00
parent 481487f084
commit b743566339

View File

@ -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_);
}