avcodec/mjpegdec: Check input buffer size.