1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-01 22:41:32 +00:00

Decline to try to surface tracks past the end of the disk.

This commit is contained in:
Thomas Harte 2023-12-09 15:36:47 -05:00
parent cbe5e69aa1
commit ada627d027

View File

@ -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<uint8_t> track_data;