multiqueue: Fix possible NULL pointer dereferencing
authorThibault Saunier <tsaunier@igalia.com>
Tue, 2 Jul 2019 21:14:50 +0000 (17:14 -0400)
committerThibault Saunier <tsaunier@igalia.com>
Tue, 2 Jul 2019 21:27:32 +0000 (17:27 -0400)
In the hotdoc inspector for example, pads are instantiated with
g_object_new, other code paths to get/set properties already make
that check.

And update doc cache

docs/plugins/gst_plugins_cache.json
plugins/elements/gstmultiqueue.c

index 78162a7..716fbeb 100644 (file)
                     "src_%%u": {
                         "caps": "ANY",
                         "direction": "src",
+                        "object-type": {
+                            "hierarchy": [
+                                "GstMultiQueuePad",
+                                "GstPad",
+                                "GstObject",
+                                "GInitiallyUnowned",
+                                "GObject"
+                            ],
+                            "properties": {
+                                "group-id": {
+                                    "blurb": "Group to which this pad belongs",
+                                    "construct": false,
+                                    "construct-only": false,
+                                    "default": "0",
+                                    "max": "-1",
+                                    "min": "0",
+                                    "type-name": "guint",
+                                    "writable": true
+                                }
+                            }
+                        },
                         "presence": "sometimes"
                     }
                 },
index b1cd84e..f5685b9 100644 (file)
@@ -394,7 +394,8 @@ gst_multiqueue_pad_finalize (GObject * object)
 {
   GstMultiQueuePad *pad = GST_MULTIQUEUE_PAD (object);
 
-  gst_single_queue_unref (pad->sq);
+  if (pad->sq)
+    gst_single_queue_unref (pad->sq);
 
   G_OBJECT_CLASS (gst_multiqueue_pad_parent_class)->finalize (object);
 }