From 29d32a8f0092175c2dbc84b745107acc229e1f12 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 11 Feb 2022 23:55:57 +0100 Subject: [PATCH] jpegdec: Pull row_stride from GST_VIDEO_FRAME_PLANE_STRIDE() The libjpeg-turbo internal state might not be correctly initialized for the first frame in a stream, pull the frame stride from gstreamer frame metadata instead, which is correct even for the first frame, and which makes this code consistent with the surrounding lines. Fixes: e6d83d8f96 ("jpegdec: Support libjpeg-turbo colorspace conversion") Part-of: --- subprojects/gst-plugins-good/ext/jpeg/gstjpegdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-good/ext/jpeg/gstjpegdec.c b/subprojects/gst-plugins-good/ext/jpeg/gstjpegdec.c index 73157cf32d..06559adc69 100644 --- a/subprojects/gst-plugins-good/ext/jpeg/gstjpegdec.c +++ b/subprojects/gst-plugins-good/ext/jpeg/gstjpegdec.c @@ -915,7 +915,7 @@ gst_jpeg_dec_decode_direct (GstJpegDec * dec, GstVideoFrame * frame, #ifdef JCS_EXTENSIONS if (dec->format_convert) { - gint row_stride = dec->cinfo.output_width * dec->cinfo.output_components; + gint row_stride = GST_VIDEO_FRAME_PLANE_STRIDE (frame, 0); guchar *bufbase = GST_VIDEO_FRAME_PLANE_DATA (frame, 0); if (num_fields == 2) {