1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-25 18:30:21 +00:00

Merge pull request #959 from TomHarte/WriteCrash

Corrects buffer placement of decoded sectors.
This commit is contained in:
Thomas Harte 2021-07-03 13:41:00 -04:00 committed by GitHub
commit bda0756620
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,6 +57,6 @@ void Storage::Disk::decode_sectors(Track &track, uint8_t *const destination, uin
if(pair.second.address.sector < first_sector) continue; if(pair.second.address.sector < first_sector) continue;
if(pair.second.size != sector_size) continue; if(pair.second.size != sector_size) continue;
if(pair.second.samples.empty()) continue; if(pair.second.samples.empty()) continue;
std::memcpy(&destination[pair.second.address.sector * byte_size], pair.second.samples[0].data(), std::min(pair.second.samples[0].size(), byte_size)); std::memcpy(&destination[(pair.second.address.sector - first_sector) * byte_size], pair.second.samples[0].data(), std::min(pair.second.samples[0].size(), byte_size));
} }
} }