From f789332a61a250d3cd31b5893b64677c674ec8b8 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 18 Jul 2011 23:35:08 -0700 Subject: [PATCH] Mix_LoadMUS(): Don't check MP3 magic when we've got filenames. This will allow corrupt, but otherwise-playable MP3s to work. We check the magic for Mix_LoadMUS_RW(), though, as we have no filenames there. --- music.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/music.c b/music.c index e37b51d4..0063e8dd 100755 --- a/music.c +++ b/music.c @@ -566,9 +566,7 @@ Mix_Music *Mix_LoadMUS(const char *file) #ifdef MP3_MUSIC if ( (ext && MIX_string_equals(ext, "MPG")) || (ext && MIX_string_equals(ext, "MP3")) || - (ext && MIX_string_equals(ext, "MPEG")) || - (magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) || - (strncmp((char *)magic, "ID3", 3) == 0) ) { + (ext && MIX_string_equals(ext, "MPEG")) ) { if ( Mix_Init(MIX_INIT_MP3) ) { SMPEG_Info info; music->type = MUS_MP3; @@ -589,8 +587,9 @@ Mix_Music *Mix_LoadMUS(const char *file) (ext && MIX_string_equals(ext, "MP3")) || (ext && MIX_string_equals(ext, "MPEG")) || (ext && MIX_string_equals(ext, "MAD")) || + /* Don't check the magic. Lots of bogus but usable MP3s out there... (magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) || - (strncmp((char *)magic, "ID3", 3) == 0) ) { + (strncmp((char *)magic, "ID3", 3) == 0)*/ ) { music->type = MUS_MP3_MAD; music->data.mp3_mad = mad_openFile(file, &used_mixer); if (music->data.mp3_mad == 0) {