Commit f850da7e authored by Seungha Yang's avatar Seungha Yang 🐑 Committed by Thibault Saunier
Browse files

framepositioner: Fix invalid memory access

The GstFramePositioner might be finalized before the notify callback

Without this commit,
gst-editing-services / ges_basic / test_ges_timeline_remove_track
can reproduce the case.
parent b2c8b23c
...@@ -210,6 +210,7 @@ static void ...@@ -210,6 +210,7 @@ static void
_trk_element_weak_notify_cb (GstFramePositioner * pos, GObject * old) _trk_element_weak_notify_cb (GstFramePositioner * pos, GObject * old)
{ {
pos->track_source = NULL; pos->track_source = NULL;
gst_object_unref (pos);
} }
void void
...@@ -221,7 +222,7 @@ ges_frame_positioner_set_source_and_filter (GstFramePositioner * pos, ...@@ -221,7 +222,7 @@ ges_frame_positioner_set_source_and_filter (GstFramePositioner * pos,
pos->current_track = ges_track_element_get_track (trksrc); pos->current_track = ges_track_element_get_track (trksrc);
g_object_weak_ref (G_OBJECT (trksrc), g_object_weak_ref (G_OBJECT (trksrc),
(GWeakNotify) _trk_element_weak_notify_cb, pos); (GWeakNotify) _trk_element_weak_notify_cb, gst_object_ref (pos));
g_signal_connect (trksrc, "notify::track", (GCallback) _track_changed_cb, g_signal_connect (trksrc, "notify::track", (GCallback) _track_changed_cb,
pos); pos);
set_track (pos); set_track (pos);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment