From 9bb8da2533e5204dde6b64d51a820c52a45d1127 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 30 Sep 2019 19:57:47 +0200 Subject: [PATCH] - fixed the CDDA check to not catch all RIFF files. --- libraries/zmusic/zmusic/zmusic.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/libraries/zmusic/zmusic/zmusic.cpp b/libraries/zmusic/zmusic/zmusic.cpp index 72fc0651ee..2d1ab1d611 100644 --- a/libraries/zmusic/zmusic/zmusic.cpp +++ b/libraries/zmusic/zmusic/zmusic.cpp @@ -221,21 +221,10 @@ MusInfo *ZMusic_OpenSong (MusicIO::FileInterface *reader, EMidiDevice device, co } // Check for CDDA "format" - else if (id[0] == (('R') | (('I') << 8) | (('F') << 16) | (('F') << 24))) + else if ((id[0] == MAKE_ID('R', 'I', 'F', 'F') && id[2] == MAKE_ID('C', 'D', 'D', 'A'))) { - uint32_t subid; - - reader->seek(8, SEEK_CUR); - if (reader->read(&subid, 4) == 4) - { - reader->seek(-12, SEEK_CUR); - - if (subid == (('C') | (('D') << 8) | (('D') << 16) | (('A') << 24))) - { - // This is a CDDA file - info = CDDA_OpenSong(reader); - } - } + // This is a CDDA file + info = CDDA_OpenSong(reader); } // Check for various raw OPL formats