Skip to content

Commit 6dcee9a

Browse files
Fixed bug writing uncompressed files
Fixed bug where uncompressed files were not written properly because the uncompressed data was deleted before it could be written. Now, the data is copied to another array and written from there. Updated release to follow.
1 parent 095c859 commit 6dcee9a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

CCBConstructor.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,10 @@ int main(int argc, char** argv) {
437437
} else if (fileList[i].compressionType == 0x00) {
438438
// Some files within CCB archives are completely uncompressed.
439439
// These files are written with no modification.
440-
fileList[i].compressedData = uncompressedData;
440+
fileList[i].compressedData = new unsigned char[fileList[i].uncompressedSize];
441+
for (int j = 0; j < fileList[i].uncompressedSize; j++) {
442+
fileList[i].compressedData[j] = uncompressedData[j];
443+
}
441444
fileList[i].compressedSize = fileList[i].uncompressedSize;
442445
}
443446

0 commit comments

Comments
 (0)