From c5a244d32cb0dc5cb7e7608b55b3caed4e9c9efa Mon Sep 17 00:00:00 2001 From: AJR Date: Sat, 28 Jul 2018 00:54:52 -0400 Subject: flopimg.h: Add debug asserts to help catch geometry errors (nw) --- src/lib/formats/flopimg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/formats/flopimg.h b/src/lib/formats/flopimg.h index fe6d8ed35dd..b7f4d542db2 100644 --- a/src/lib/formats/flopimg.h +++ b/src/lib/formats/flopimg.h @@ -735,7 +735,7 @@ public: @param head head number @return a pointer to the data buffer for this track and head */ - std::vector &get_buffer(int track, int head, int subtrack = 0) { return track_array[track*4+subtrack][head].cell_data; } + std::vector &get_buffer(int track, int head, int subtrack = 0) { assert(track < tracks && head < heads); return track_array[track*4+subtrack][head].cell_data; } //! Sets the write splice position. //! The "track splice" information indicates where to start writing @@ -749,9 +749,9 @@ public: @param head @param pos the position */ - void set_write_splice_position(int track, int head, uint32_t pos, int subtrack = 0) { track_array[track*4+subtrack][head].write_splice = pos; } + void set_write_splice_position(int track, int head, uint32_t pos, int subtrack = 0) { assert(track < tracks && head < heads); track_array[track*4+subtrack][head].write_splice = pos; } //! @return the current write splice position. - uint32_t get_write_splice_position(int track, int head, int subtrack = 0) const { return track_array[track*4+subtrack][head].write_splice; } + uint32_t get_write_splice_position(int track, int head, int subtrack = 0) const { assert(track < tracks && head < heads); return track_array[track*4+subtrack][head].write_splice; } //! @return the maximal geometry supported by this format. void get_maximal_geometry(int &tracks, int &heads) const; -- cgit v1.2.3