JPEG image decode failed in decodeToFd

JPEG image decode failed in decodeToFd. As follows:

if ((cinfo.output_width % (cinfo.max_h_samp_factor * DCTSIZE))
    && pixel_format == V4L2_PIX_FMT_YUV420M)
{
    COMP_ERROR_MSG("decodeToFd() failed, please run decodeToBuffer()");
    jpeg_finish_decompress(&cinfo);
    profiler.finishProcessing(buffer_id, false);
    return -1;
}

Hi,
The JPEG file is not supported in calling decodeToFd(). Please call decodeToBuffer().

But, some jpeg file can be decoded. why?

Hi,
The patch is added to fix the issue: