diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkdec.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkdec.c index bc7fb52884..95fff479d0 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkdec.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkdec.c @@ -393,8 +393,8 @@ gst_msdkdec_init_decoder (GstMsdkDec * thiz) thiz->param.AsyncDepth = thiz->async_depth; /* We expect msdk to fill the width and height values */ - g_return_val_if_fail (thiz->param.mfx.FrameInfo.Width - && thiz->param.mfx.FrameInfo.Height, FALSE); + if (!(thiz->param.mfx.FrameInfo.Width && thiz->param.mfx.FrameInfo.Height)) + goto failed; klass->preinit_decoder (thiz); diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkmjpegdec.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkmjpegdec.c index 6d515167ff..a9cff9a4c5 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkmjpegdec.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkmjpegdec.c @@ -106,6 +106,7 @@ static gboolean gst_msdkmjpegdec_post_configure (GstMsdkDec * decoder) { /* Set the output color format based on the input color format */ + GST_OBJECT_LOCK (decoder); switch (decoder->param.mfx.JPEGChromaFormat) { case MFX_CHROMAFORMAT_YUV422: decoder->param.mfx.FrameInfo.FourCC = MFX_FOURCC_YUY2; @@ -116,6 +117,7 @@ gst_msdkmjpegdec_post_configure (GstMsdkDec * decoder) break; } + GST_OBJECT_UNLOCK (decoder); return TRUE; }