avcodec/mjpegdec: Add some sanity checks to ljpeg_decode_rgb_scan()