mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-30 02:58:24 +00:00
tests/padmonitor: Correcly strdup the result of get_metadata.
The const pointer was becoming invalid after the first call to add_metadata, and we ended up setting corrupted data on the second call.
This commit is contained in:
parent
3e557ca92b
commit
1fcaf8918f
1 changed files with 3 additions and 3 deletions
|
@ -95,7 +95,7 @@ GST_START_TEST (buffer_outside_segment)
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstSegment segment;
|
GstSegment segment;
|
||||||
GstElement *src, *sink;
|
GstElement *src, *sink;
|
||||||
const gchar *fakesrc_klass;
|
gchar *fakesrc_klass;
|
||||||
GstValidateReport *report;
|
GstValidateReport *report;
|
||||||
GstValidateRunner *runner;
|
GstValidateRunner *runner;
|
||||||
GstValidateMonitor *monitor;
|
GstValidateMonitor *monitor;
|
||||||
|
@ -106,7 +106,7 @@ GST_START_TEST (buffer_outside_segment)
|
||||||
sink = gst_element_factory_make ("fakesink", "fakesink");
|
sink = gst_element_factory_make ("fakesink", "fakesink");
|
||||||
|
|
||||||
fakesrc_klass =
|
fakesrc_klass =
|
||||||
gst_element_class_get_metadata (GST_ELEMENT_GET_CLASS (src), "klass");
|
g_strdup (gst_element_class_get_metadata (GST_ELEMENT_GET_CLASS (src), "klass"));
|
||||||
|
|
||||||
/* Testing if a buffer is outside a segment is only done for buffer outputed
|
/* Testing if a buffer is outside a segment is only done for buffer outputed
|
||||||
* from decoders for the moment, fake a Decoder so that the test is properly
|
* from decoders for the moment, fake a Decoder so that the test is properly
|
||||||
|
@ -134,7 +134,6 @@ GST_START_TEST (buffer_outside_segment)
|
||||||
gst_event_new_stream_start ("the-stream")));
|
gst_event_new_stream_start ("the-stream")));
|
||||||
fail_unless (gst_pad_push_event (srcpad, gst_event_new_segment (&segment)));
|
fail_unless (gst_pad_push_event (srcpad, gst_event_new_segment (&segment)));
|
||||||
|
|
||||||
|
|
||||||
/* Pushing a buffer that is outside the segment */
|
/* Pushing a buffer that is outside the segment */
|
||||||
{
|
{
|
||||||
buffer = gst_buffer_new ();
|
buffer = gst_buffer_new ();
|
||||||
|
@ -166,6 +165,7 @@ GST_START_TEST (buffer_outside_segment)
|
||||||
|
|
||||||
gst_element_class_add_metadata (GST_ELEMENT_GET_CLASS (src), "klass",
|
gst_element_class_add_metadata (GST_ELEMENT_GET_CLASS (src), "klass",
|
||||||
fakesrc_klass);
|
fakesrc_klass);
|
||||||
|
g_free (fakesrc_klass);
|
||||||
gst_object_unref (src);
|
gst_object_unref (src);
|
||||||
gst_object_unref (runner);
|
gst_object_unref (runner);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue