Musescore nightly build crashing after selecting lame_enc.dll for mp3 export

• Mar 19, 2014 - 02:30
Type
Functional
Severity
S2 - Critical
Status
closed
Project

I'm using Windows XP, SP3
Nightly build is from Mar. 18th rev 9cde62c
I tried to point to a lame encoder dated 8-8-2003 at following link:
D:\Program Files\Magic Audio Converter\lame_enc.dll

Maybe the spaces in the path are causing a crash? The error message says cannot open the lame_enc file. When I click OK it generates abnormal termination 'must close' message which cause program to close when ok is clicked.


Comments

When LAME MP3 output was implemented, I reported similar findings. I was told that _only_ the LAME version that was made (modded?) for Audacity was supported. You will have to try the "Lame for Audacity" version.

Indeed, MuseScore is not able to load this dll. However, it should not crash.
The crash is due because the QLibrary object lame_lib is deleted twice when the loading of the library fails.
First, when the initialization of the library fails in initLibrary, at line 284 of mscore\exportmp3.cpp; second, when the MP3Exporter object is deleted, at line 307 of mscore\exportmp3.cpp.
It is probably also extremely dangerous to call lame_lib->unload() at line 306 of mscore\exportmp3.cpp when the library has already been deleted (when the library loading has failed).

I guess moving the } from line mscore/exportmp3.cpp line 305 two lines down would solve this.
Maybe additionally do the unload and delete when lame_init() fails, in line 290

Attached is Lame encoder dll that caused crash. You need to change the file extension from txt to dll. System wouldn't let me upload dll understandably.

Attachment Size
lame_enc.txt 232 KB
Status (old) patch (code needs review) patch (ready to commit)

Thanks. My fix does fix the crash and give an error message instead

Attached the working dll, in case you need that.

Attachment Size
lame_enc.txt 412 KB