From c64af53210510baee118c6fa5e6208aed7b737f4 Mon Sep 17 00:00:00 2001 From: Jesse Marroquin <14297328+jessexm@users.noreply.github.com> Date: Sun, 29 Aug 2021 12:28:21 -0500 Subject: wd177x_dsk.cpp: Add head count check Prevents further evaluation of incompatible formats. --- src/lib/formats/wd177x_dsk.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/formats/wd177x_dsk.cpp b/src/lib/formats/wd177x_dsk.cpp index da900b03db5..75f3396020f 100644 --- a/src/lib/formats/wd177x_dsk.cpp +++ b/src/lib/formats/wd177x_dsk.cpp @@ -441,8 +441,8 @@ void wd177x_format::check_compatibility(floppy_image *image, std::vector &c int max_tracks, max_heads; image->get_maximal_geometry(max_tracks, max_heads); - // Fail if floppy drive can't handle track count - if(f.track_count > max_tracks) { + // Fail if floppy drive can't handle track or head count + if(f.track_count > max_tracks || f.head_count > max_heads) { goto fail; } -- cgit v1.2.3