diff --git a/src/iso/iso_type.rs b/src/iso/iso_type.rs index 9349641..4e1ab68 100644 --- a/src/iso/iso_type.rs +++ b/src/iso/iso_type.rs @@ -47,10 +47,13 @@ impl IsoType { fn check(mut reader: R, iso_type: IsoType) -> Result { let mut buf = [0_u8; 20]; - - reader.seek(SeekFrom::Start(0x20 * SECTOR_SIZE + iso_type.root_offset()))?; - reader.read_exact(&mut buf)?; - - Ok(buf == "MICROSOFT*XBOX*MEDIA".as_bytes()) + match reader + .seek(SeekFrom::Start(0x20 * SECTOR_SIZE + iso_type.root_offset())) + .and_then(|_| reader.read_exact(&mut buf)) + { + Ok(_) => Ok(&buf == b"MICROSOFT*XBOX*MEDIA"), + Err(e) if e.kind() == std::io::ErrorKind::UnexpectedEof => Ok(false), + Err(e) => Err(e.into()), + } } }