From ca125bd304d333c8c087f4f4ecf29655fae1fb14 Mon Sep 17 00:00:00 2001 From: Yinhang Liu Date: Fri, 21 Apr 2023 10:19:32 +0800 Subject: [PATCH] msdk: Add return when creating caps fails for VPP When creating caps fails, the function should return immediately and should not continue to register the plugin. This patch fixes the issue of "gst_mini_object_ref: assertion 'mini_object != NULL' failed" in https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2506 Part-of: --- subprojects/gst-plugins-bad/sys/msdk/gstmsdk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdk.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdk.c index 8989256153..96f87fd4d2 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdk.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdk.c @@ -272,6 +272,7 @@ _register_vpp (GstPlugin * plugin, if (!gst_msdkcaps_vpp_create_caps (context, vpp_desc, &sink_caps, &src_caps)) { GST_WARNING ("Failed to create caps for VPP"); + return; } if (!gst_msdkvpp_register (plugin, @@ -373,6 +374,7 @@ _register_vpp (GstPlugin * plugin, GstMsdkContext * context) if (!gst_msdkcaps_vpp_create_caps (context, NULL, &sink_caps, &src_caps)) { GST_WARNING ("Failed to create caps for VPP"); + return; } if (!gst_msdkvpp_register (plugin, context,