Closed tommitytom closed 4 years ago
If a sav file contains multiple songs, when writing the sav with lsdj_sav_write_to_file or lsdj_sav_write_to_memory, songs are erroneously removed from the written sav.
lsdj_sav_write_to_file
lsdj_sav_write_to_memory
Test case:
int main() { size_t writeCount = 0; lsdj_sav_t* sav; lsdj_sav_read_from_file("liblsdj-bug.sav", &sav, nullptr); lsdj_sav_write_to_file(sav, "liblsdj-bug-out.sav", &writeCount); lsdj_sav_free(sav); return 0; }
Test file: https://tommitytom.co.uk/liblsdj-bug.sav
This file contains 4 songs:
After running the above code, the top 3 songs are missing:
Fixed it! Block allocation table wasn't written out correctly.
If a sav file contains multiple songs, when writing the sav with
lsdj_sav_write_to_file
orlsdj_sav_write_to_memory
, songs are erroneously removed from the written sav.Test case:
Test file: https://tommitytom.co.uk/liblsdj-bug.sav
This file contains 4 songs:
After running the above code, the top 3 songs are missing: