1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +00:00

Caps the number of sync bytes inserted at five.

This commit is contained in:
Thomas Harte 2018-06-06 21:52:26 -04:00
parent 9ac21a4e71
commit 744c35b617

View File

@ -80,12 +80,12 @@ std::shared_ptr<::Storage::Disk::Track> NIB::get_track_at_position(::Storage::Di
if(track_data[index] == 0xd5 && track_data[(index+1)%track_data.size()] == 0xaa) {
size_t start = index - 1;
size_t length = 0;
while(track_data[start] == 0xff) {
while(track_data[start] == 0xff && length < 5) {
start = (start + track_data.size() - 1) % track_data.size();
++length;
}
if(length >= 5) {
if(length == 5) {
sync_starts.insert((start + 1) % track_data.size());
if(start > index)
start_index = start;