We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2765 - Mix_LoadMUS(.mp3) crashes when MP3 file has an album art embedded
Summary: Mix_LoadMUS(.mp3) crashes when MP3 file has an album art embedded
Status: RESOLVED FIXED
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: 2.0.0
Hardware: x86_64 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-23 22:47 UTC by Philippe
Modified: 2017-10-18 08:21 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe 2014-10-23 22:47:01 UTC
Using function Mix_LoadMUS() in order to load a MP3 image file makes the application crash when the MP3 image file has an album art embedded (you can see it, for example, while it plays on Windows Media Player). It may also be some tag associated with the file that causes the problem.

How to reproduce :

1)Download a MP3 file that has an album art embedded in it (I personally used the track Round Drums by Kevin MacLeod : http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100561 )

2)Place it in your project directory.

3)Load it with Mix_LoadMUS().

The application should crash and the console should indicate the following :

terminate called after throwing an instance of 'std::bad_alloc'
what<>: std::bad_alloc
 
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.
 
Process returned 3 (etc.)

It is very likely that it is the album art (or at least some tag associated with the file) that caused the problem, because I solved it by downloading the software "Mp3Tag" ( http://www.mp3tag.de/en/ ) and removing all tags associated with the MP3 file, including the album art. I had already tried to remove textual tags such as "author", "title", etc. by hand but it did not have any effect.
Comment 1 saurabh tiwari 2015-07-23 09:07:34 UTC
smpeg2.dll, which is being used is old and have some issue.
If we rebuild smpeg2.dll and use the new one, It will fix this issue.
Comment 2 Sam Lantinga 2017-10-18 07:30:14 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL_mixer/rev/23626ec410c8
Comment 3 Ozkan Sezer 2017-10-18 08:21:03 UTC
Please also change smpeg default option to no in configury:

diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -573,8 +573,8 @@
               [], enable_music_mp3=yes)
 
 AC_ARG_ENABLE(music-mp3-smpeg,
-AC_HELP_STRING([--enable-music-mp3-smpeg], [enable MP3 music via smpeg [[default=yes]]]),
-              [], enable_music_mp3_smpeg=yes)
+AC_HELP_STRING([--enable-music-mp3-smpeg], [enable MP3 music via smpeg [[default=no]]]),
+              [], enable_music_mp3_smpeg=no)
 AC_ARG_ENABLE([music-mp3-smpeg-shared],
 AC_HELP_STRING([--enable-music-mp3-smpeg-shared], [dynamically load smpeg library [[default=yes]]]),
               [], [enable_music_mp3_smpeg_shared=yes])
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -1585,7 +1585,7 @@
                           dynamically load FLAC library [[default=yes]]
   --enable-music-mp3      enable MP3 music [[default=yes]]
   --enable-music-mp3-smpeg
-                          enable MP3 music via smpeg [[default=yes]]
+                          enable MP3 music via smpeg [[default=no]]
   --enable-music-mp3-smpeg-shared
                           dynamically load smpeg library [[default=yes]]
   --disable-smpegtest     Do not try to compile and run a test SMPEG program
@@ -12567,7 +12567,7 @@
 if test "${enable_music_mp3_smpeg+set}" = set; then :
   enableval=$enable_music_mp3_smpeg;
 else
-  enable_music_mp3_smpeg=yes
+  enable_music_mp3_smpeg=no
 fi
 
 # Check whether --enable-music-mp3-smpeg-shared was given.