From fedf5a44a68726919298d20ddbdfc9e5068c6fc3 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 17 Aug 2017 15:20:49 -0400 Subject: [PATCH] Imposes a maximum track length. --- Storage/Disk/Encodings/MFM.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Storage/Disk/Encodings/MFM.cpp b/Storage/Disk/Encodings/MFM.cpp index 3808baff2..dfe9330c7 100644 --- a/Storage/Disk/Encodings/MFM.cpp +++ b/Storage/Disk/Encodings/MFM.cpp @@ -173,6 +173,7 @@ template std::shared_ptr } while(segment.data.size() < expected_track_bytes) shifter.add_byte(0x00); + if(segment.data.size() > expected_track_bytes) segment.data.resize(expected_track_bytes); segment.number_of_bits = (unsigned int)(segment.data.size() * 8); return std::shared_ptr(new Storage::Disk::PCMTrack(std::move(segment)));