mjpegdec: check buffer before using it

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
id3v2: allocate large enough buffer

Fixes array overread

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>