From 16d969b945d897c931e7727641ef4cd0df7027a5 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Tue, 13 May 2014 11:22:58 -0300 Subject: [PATCH] dashdemux: mpdparser: properly unref gstdatetime Avoid leaking the GstDateTime instances when summing dates CID #1212143 --- ext/dash/gstmpdparser.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index a6f12f1085..b1e30fd774 100644 --- a/ext/dash/gstmpdparser.c +++ b/ext/dash/gstmpdparser.c @@ -3477,11 +3477,16 @@ gst_mpd_client_get_segment_index_at_time (GstMpdClient * client, return -1; if (stream_period && stream_period->period) { - /* intentionally not unreffing avail_start */ - avail_start = gst_mpd_client_add_time_difference (avail_start, + GstDateTime *t; + + t = gst_mpd_client_add_time_difference (avail_start, stream_period->period->start * 1000); + gst_date_time_unref (avail_start); + avail_start = t; } diff = gst_mpd_client_calculate_time_difference (avail_start, time); + gst_date_time_unref (avail_start); + if (diff < 0) return -2; if (diff > gst_mpd_client_get_media_presentation_duration (client))