FFmpeg: Fix potential crash on some codecs (speex for example)