Merge pull request #4778 from AmatCoder/AmatCoder-dsk_dsk-1

dsk_dsk.cpp: Avoid segfault if double sided DSK image is loaded on si…
This commit is contained in:
ajrhacker 2019-03-19 18:08:40 -04:00 committed by GitHub
commit 9e52e9cede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -362,6 +362,12 @@ bool dsk_format::load(io_generic *io, uint32_t form_factor, floppy_image *image)
skip = 2;
}
int tracks = header[0x30];
int img_tracks, img_heads;
image->get_maximal_geometry(img_tracks, img_heads);
if (tracks > img_tracks || heads > img_heads)
return false;
uint64_t track_offsets[84*2];
int cnt =0;
if (!extendformat) {