mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
encodebin: guard against gst_pad_get_peer returning NULL
If it does, the pad may be leaked if it's a request pad, though. Coverity 1139799
This commit is contained in:
parent
1afa3040b8
commit
ea176f3865
1 changed files with 8 additions and 6 deletions
|
@ -1890,14 +1890,16 @@ stream_group_free (GstEncodeBin * ebin, StreamGroup * sgroup)
|
|||
tmppad = gst_element_get_static_pad (sgroup->outqueue, "src");
|
||||
pad = gst_pad_get_peer (tmppad);
|
||||
|
||||
if (pad) {
|
||||
/* Remove muxer request sink pad */
|
||||
gst_pad_unlink (tmppad, pad);
|
||||
if (GST_PAD_TEMPLATE_PRESENCE (GST_PAD_PAD_TEMPLATE (pad)) ==
|
||||
GST_PAD_REQUEST)
|
||||
gst_element_release_request_pad (ebin->muxer, pad);
|
||||
gst_object_unref (tmppad);
|
||||
gst_object_unref (pad);
|
||||
}
|
||||
gst_object_unref (tmppad);
|
||||
}
|
||||
if (sgroup->outqueue)
|
||||
gst_element_set_state (sgroup->outqueue, GST_STATE_NULL);
|
||||
|
||||
|
|
Loading…
Reference in a new issue