diff options
author | Seungha Yang <sh.yang@lge.com> | 2017-02-02 21:06:20 +0900 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-03-02 20:24:00 +0200 |
commit | 5bd4bc8080525328deb4d1013a96d4ede925e028 (patch) | |
tree | 6e940454afce806c480f405a5013547f262c0f62 /ext/hls | |
parent | e28ddbdf77d362e8c124bd8eef8f70495591e829 (diff) | |
download | gstreamer-plugins-bad-5bd4bc8080525328deb4d1013a96d4ede925e028.tar.gz |
hls: Fix various leak on hlsdemux and m3u8
* default_variant should be freed, it holds ref.
* GstHLSMedia holds GstM3U8 ref.
* gst_m3u8_get_next_fragment() increases ref count.
https://bugzilla.gnome.org/show_bug.cgi?id=778073
Diffstat (limited to 'ext/hls')
-rw-r--r-- | ext/hls/gsthlsdemux.c | 2 | ||||
-rw-r--r-- | ext/hls/m3u8.c | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c index 32df21476..574485b54 100644 --- a/ext/hls/gsthlsdemux.c +++ b/ext/hls/gsthlsdemux.c @@ -1114,6 +1114,8 @@ gst_hls_demux_update_fragment_info (GstAdaptiveDemuxStream * stream) if (discont) stream->discont = TRUE; + gst_m3u8_media_file_unref (file); + return GST_FLOW_OK; } diff --git a/ext/hls/m3u8.c b/ext/hls/m3u8.c index 3bac7bfaa..edf08ac4f 100644 --- a/ext/hls/m3u8.c +++ b/ext/hls/m3u8.c @@ -1182,9 +1182,12 @@ gst_hls_media_unref (GstHLSMedia * media) { g_assert (media != NULL && media->ref_count > 0); if (g_atomic_int_dec_and_test (&media->ref_count)) { + if (media->playlist) + gst_m3u8_unref (media->playlist); g_free (media->group_id); g_free (media->name); g_free (media->uri); + g_free (media->lang); g_free (media); } } @@ -1402,6 +1405,8 @@ gst_hls_master_playlist_unref (GstHLSMasterPlaylist * playlist) (GDestroyNotify) gst_hls_variant_stream_unref); g_list_free_full (playlist->iframe_variants, (GDestroyNotify) gst_hls_variant_stream_unref); + if (playlist->default_variant) + gst_hls_variant_stream_unref (playlist->default_variant); g_free (playlist->last_data); g_free (playlist); } |