diff --git a/floppy/src/loaders/auto.rs b/floppy/src/loaders/auto.rs index 875aca9..3d5b7f8 100644 --- a/floppy/src/loaders/auto.rs +++ b/floppy/src/loaders/auto.rs @@ -69,7 +69,7 @@ impl Autodetect { return Ok(ImageType::Bitfile); } // Apple DiskCopy 4.2 - if data[0x52..=0x53] == [0x01, 0x00] { + if data.len() > 0x53 && data[0x52..=0x53] == [0x01, 0x00] { return Ok(ImageType::DC42); } // Raw image