diff options
Diffstat (limited to 'src/lib/formats/imd_dsk.cpp')
-rw-r--r-- | src/lib/formats/imd_dsk.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/formats/imd_dsk.cpp b/src/lib/formats/imd_dsk.cpp index cce87fa64f2..8476da6ac38 100644 --- a/src/lib/formats/imd_dsk.cpp +++ b/src/lib/formats/imd_dsk.cpp @@ -492,10 +492,13 @@ bool imd_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) } } - if(fm) - build_pc_track_fm(track, head, image, cell_count, sector_count, sects, gap_3); - else - build_pc_track_mfm(track, head, image, cell_count, sector_count, sects, gap_3); + if(sector_count) { + if(fm) { + build_pc_track_fm(track, head, image, cell_count, sector_count, sects, gap_3); + } else { + build_pc_track_mfm(track, head, image, cell_count, sector_count, sects, gap_3); + } + } for(int i=0; i<sector_count; i++) if(sects[i].data && (sects[i].data < &img[0] || sects[i].data >= (&img[0] + size))) |