Hello Marc, thank you very much for your feedback. On VLC side, our current assumption is that this mostly happens when the user heavily seeks in the input data stream. This probably also causes some "bad" or invalid data being passed to the lame encoder, after the stream is flushed. This sound similar to what you are describing. However, at least my assumption is even with invalid raw audio input data, lame should still be able to somehow encode those instead of crashing (even if it might sound...
Crash in lame in psymodel.c:calc_energy