Syncpts and threads leak using gstreamer plugin nvv4l2decoder

Hi,
There is a patch for this issue:

diff --git a/gst-v4l2/gstv4l2object.c b/gst-v4l2/gstv4l2object.c
index c0eae06..ce0a239 100644
--- a/gst-v4l2/gstv4l2object.c
+++ b/gst-v4l2/gstv4l2object.c
@@ -3733,6 +3733,13 @@ gst_v4l2_object_set_format_full (GstV4l2Object * v4l2object, GstCaps * caps,
       (v4l2object->open_mjpeg_block == TRUE) &&
       (g_str_equal(gst_structure_get_name(gst_caps_get_structure (caps, 0)), "image/jpeg")))
     format.fmt.pix_mp.pixelformat = pixelformat = V4L2_PIX_FMT_MJPEG;
+  else if ((!strcmp (v4l2object->videodev, V4L2_DEVICE_PATH_NVDEC)) &&
+           V4L2_TYPE_IS_OUTPUT (v4l2object->type) &&
+           (width == 0 || height == 0)) {
+    GST_WARNING_OBJECT (v4l2object->dbg_obj,
+        "Invalid caps: %s", gst_caps_to_string(caps));
+    goto invalid_caps;
+  }
 #endif
 
   if (try_only) {
diff --git a/gst-v4l2/gstv4l2videodec.c b/gst-v4l2/gstv4l2videodec.c
index 4458e80..a40cf55 100644
--- a/gst-v4l2/gstv4l2videodec.c
+++ b/gst-v4l2/gstv4l2videodec.c
@@ -772,8 +772,10 @@ gst_v4l2_video_dec_set_format (GstVideoDecoder * decoder,
 
   if (ret)
     self->input_state = gst_video_codec_state_ref (state);
-  else
+  else {
     gst_v4l2_error (self, &error);
+    return FALSE;
+  }
 
 #ifdef USE_V4L2_TARGET_NV
   {
-- 
2.7.4

Please download source code of gst-v4l2, apply the patch, rebuild/replace libgstnvvideo4linux2.so and give it a try.

1 Like