From ada627d02767a35b68d3df458c58e2d4a783b21f Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 9 Dec 2023 15:36:47 -0500 Subject: [PATCH] Decline to try to surface tracks past the end of the disk. --- Storage/Disk/DiskImage/Formats/NIB.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Storage/Disk/DiskImage/Formats/NIB.cpp b/Storage/Disk/DiskImage/Formats/NIB.cpp index b9c9d1834..cf2eaf8b0 100644 --- a/Storage/Disk/DiskImage/Formats/NIB.cpp +++ b/Storage/Disk/DiskImage/Formats/NIB.cpp @@ -58,6 +58,7 @@ std::shared_ptr<::Storage::Disk::Track> NIB::get_track_at_position(::Storage::Di // NIBs contain data for even-numbered tracks underneath a single head only. if(address.head) return nullptr; if(address.position.as_quarter() & 2) return nullptr; + if(address.position.as_int() >= number_of_tracks) return nullptr; long offset = file_offset(address); std::vector track_data;