[kwm] fix: magic header detection

This commit is contained in:
鲁树人 2024-09-15 16:19:42 +01:00
parent 42f29abff3
commit dad2d9c841

View File

@ -91,8 +91,8 @@ impl Header {
let mut format_name = [0u8; 0x0C];
cursor.read_exact(&mut format_name)?;
if magic != Self::MAGIC_1 || magic != Self::MAGIC_2 {
Err(KuwoCryptoError::InvalidHeaderMagic(magic))?;
if magic != Self::MAGIC_1 && magic != Self::MAGIC_2 {
Err(KuwoCryptoError::InvalidHeaderMagic(HeaderMagicBytes(magic)))?;
}
Ok(Self {