mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +00:00
ges-timeline-element: Fix refcount bug in "timeline" and "parent" properties
ges-timeline-element property getter handler was using g_value_take_object() with internal pointers of the element as arguments, instead of g_value_set_object(). g_value_take_object() moves the ownership of the reference; hence, when reading "timeline" the reference ownership of timeline is moved away from the ges-timeline-element and into the GValue. Since GValues are temporaries that are often discarded quickly after, this can easily lead to a double free. This was causing gst-editing-services / pythontests to crash when running TestTrackElements.test_ungroup_regroup() because of an innocent read of `clip2.props.timeline` around the end of the test. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4924>
This commit is contained in:
parent
fd25e24217
commit
64b4257509
1 changed files with 2 additions and 2 deletions
|
@ -295,10 +295,10 @@ _get_property (GObject * object, guint property_id,
|
||||||
|
|
||||||
switch (property_id) {
|
switch (property_id) {
|
||||||
case PROP_PARENT:
|
case PROP_PARENT:
|
||||||
g_value_take_object (value, self->parent);
|
g_value_set_object (value, self->parent);
|
||||||
break;
|
break;
|
||||||
case PROP_TIMELINE:
|
case PROP_TIMELINE:
|
||||||
g_value_take_object (value, self->timeline);
|
g_value_set_object (value, self->timeline);
|
||||||
break;
|
break;
|
||||||
case PROP_START:
|
case PROP_START:
|
||||||
g_value_set_uint64 (value, self->start);
|
g_value_set_uint64 (value, self->start);
|
||||||
|
|
Loading…
Reference in a new issue