mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-15 23:21:12 +02:00
Fix for crash when importing mp3s with duplicate tags by hardcoding the importer not to handle .mp3 extension. The previous svn rev. 11457 fixes this bug, but this commit is for linux systems that use system libsndfile which will still cause the bug. Unfortunately, this means that wavs mislabeled as .mp3 will no longer be read by libsndfile. Also for system libsndfile on linux, this bug will still exists for mp3s mislabelled as .wav
This commit is contained in:
@@ -127,6 +127,18 @@ ImportFileHandle *PCMImportPlugin::Open(wxString filename)
|
||||
|
||||
wxFile f; // will be closed when it goes out of scope
|
||||
|
||||
if (filename.Lower().EndsWith(wxT("mp3"))) {
|
||||
// There is a bug in libsndfile where mp3s with duplicated metadata tags
|
||||
// will crash libsndfile and thus audacity.
|
||||
// This happens in sf_open_fd, which is the very first point of
|
||||
// interaction with libsndfile, so the only workaround is to hardcode
|
||||
// ImportPCM to not handle .mp3. Of couse, this will still fail for mp3s
|
||||
// that are mislabeled with a .wav or other extension.
|
||||
// So, in the future we may want to write a simple parser to detect mp3s here.
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if (f.Open(filename)) {
|
||||
// Even though there is an sf_open() that takes a filename, use the one that
|
||||
// takes a file descriptor since wxWidgets can open a file with a Unicode name and
|
||||
|
Reference in New Issue
Block a user