It is imperative that the libjpeg-turbo state is properly initialized
before jpeg_start_decompress() is called. Make sure cinfo.out_color_space
and cinfo.raw_data_out are set to their final values matching their peer
caps before calling jpeg_start_decompress().
Fixes:
e6d83d8f96 ("jpegdec: Support libjpeg-turbo colorspace conversion")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1687>
dec->cinfo.do_block_smoothing = FALSE;
dec->cinfo.dct_method = dec->idct_method;
#ifdef JCS_EXTENSIONS
+ gst_jpeg_turbo_parse_ext_fmt_convert (dec, NULL);
if (dec->format_convert) {
dec->cinfo.out_color_space = dec->libjpeg_ext_format;
dec->cinfo.raw_data_out = FALSE;