mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
tests: mpegtsmux: Avoid use-after-unref
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1411>
This commit is contained in:
parent
cba9ba9b38
commit
076189e2dc
1 changed files with 3 additions and 2 deletions
|
@ -79,11 +79,12 @@ setup_src_pad (GstElement * element,
|
||||||
* task of tsmux if it just happens to iterate over the pads */
|
* task of tsmux if it just happens to iterate over the pads */
|
||||||
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK,
|
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK,
|
||||||
"Could not link source and %s sink pads", GST_ELEMENT_NAME (element));
|
"Could not link source and %s sink pads", GST_ELEMENT_NAME (element));
|
||||||
gst_object_unref (sinkpad); /* because we got it higher up */
|
|
||||||
|
|
||||||
if (padname)
|
if (padname)
|
||||||
*padname = g_strdup (GST_PAD_NAME (sinkpad));
|
*padname = g_strdup (GST_PAD_NAME (sinkpad));
|
||||||
|
|
||||||
|
gst_object_unref (sinkpad); /* because we got it higher up */
|
||||||
|
|
||||||
return srcpad;
|
return srcpad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -371,9 +372,9 @@ GST_START_TEST (test_reappearing_pad)
|
||||||
|
|
||||||
pad = gst_element_get_static_pad (mux, padname);
|
pad = gst_element_get_static_pad (mux, padname);
|
||||||
gst_pad_set_active (mysrcpad, FALSE);
|
gst_pad_set_active (mysrcpad, FALSE);
|
||||||
gst_object_unref (pad);
|
|
||||||
teardown_src_pad (mux, padname);
|
teardown_src_pad (mux, padname);
|
||||||
gst_element_release_request_pad (mux, pad);
|
gst_element_release_request_pad (mux, pad);
|
||||||
|
gst_object_unref (pad);
|
||||||
g_free (padname);
|
g_free (padname);
|
||||||
|
|
||||||
mysrcpad = setup_src_pad (mux, &video_src_template, "sink_%d", &padname);
|
mysrcpad = setup_src_pad (mux, &video_src_template, "sink_%d", &padname);
|
||||||
|
|
Loading…
Reference in a new issue