From ee3c7700829c2c20283aa300dc70c48a03163a92 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 5 Nov 2023 20:58:37 +1000 Subject: [PATCH] CDImage: Fix incorrect CRC-16 computation --- src/util/cd_image.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/cd_image.cpp b/src/util/cd_image.cpp index 81d1821c3..6d0feeec8 100644 --- a/src/util/cd_image.cpp +++ b/src/util/cd_image.cpp @@ -507,7 +507,8 @@ u16 CDImage::SubChannelQ::ComputeCRC(const Data& data) for (u32 i = 0; i < 10; i++) value = crc16_table[(value >> 8) ^ data[i]] ^ (value << 8); - return ~(value >> 8) | (~(value) << 8); + value = ~value; + return (value >> 8) | (value << 8); } bool CDImage::SubChannelQ::IsCRCValid() const