kripken/emscripten — pull request #865 by akrennmair (2013-02-21 14:52:04+00:00)
Title: Fix crash when using optimization to build libmp3lame.

Hi,

I discovered that building libmp3lame using emscripten would crash if I use any optimization flags. That's how I build libmp3lame with emscripten: https://github.com/akrennmair/libmp3lame-js

I dug a little deeper, and found out that the problem lies in src/parseTools.js:1700. That's where the whole thing crashes because typeData is null, but fields are referenced without any further checks. When I surrounded the whole thing by an additional check on the validity of typeData. With this change, the issue goes away and I can build libmp3lame with -O2.

Best regards,
Andreas Krennmair