summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>2020-07-07 14:01:31 +0200
committerJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>2020-07-07 14:05:04 +0200
commit076189e2dc86c0f6d53ac48edb2a626e170b4c43 (patch)
treec5451cce8d268d89f4dd3ad86ed680cffa98ea46 /tests
parentcba9ba9b38de559de82b54bf66fef0a7f4c1af94 (diff)
downloadgstreamer-plugins-bad-076189e2dc86c0f6d53ac48edb2a626e170b4c43.tar.gz
tests: mpegtsmux: Avoid use-after-unref
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1411>
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/mpegtsmux.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/check/elements/mpegtsmux.c b/tests/check/elements/mpegtsmux.c
index 613dc59e6..6abca47f9 100644
--- a/tests/check/elements/mpegtsmux.c
+++ b/tests/check/elements/mpegtsmux.c
@@ -79,11 +79,12 @@ setup_src_pad (GstElement * element,
* task of tsmux if it just happens to iterate over the pads */
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK,
"Could not link source and %s sink pads", GST_ELEMENT_NAME (element));
- gst_object_unref (sinkpad); /* because we got it higher up */
if (padname)
*padname = g_strdup (GST_PAD_NAME (sinkpad));
+ gst_object_unref (sinkpad); /* because we got it higher up */
+
return srcpad;
}
@@ -371,9 +372,9 @@ GST_START_TEST (test_reappearing_pad)
pad = gst_element_get_static_pad (mux, padname);
gst_pad_set_active (mysrcpad, FALSE);
- gst_object_unref (pad);
teardown_src_pad (mux, padname);
gst_element_release_request_pad (mux, pad);
+ gst_object_unref (pad);
g_free (padname);
mysrcpad = setup_src_pad (mux, &video_src_template, "sink_%d", &padname);