Skip to content

Commit

Permalink
Mix_LoadMUS(): Don't check MP3 magic when we've got filenames.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
icculus committed Jul 19, 2011
1 parent e6e85f0 commit f789332
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions music.c
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down

0 comments on commit f789332

Please sign in to comment.