hlsdemux: Fix memory leak caused by double buffer map

https://bugzilla.gnome.org/show_bug.cgi?id=789999
This commit is contained in:
Jun Xie 2017-11-09 12:36:44 +08:00 committed by Sebastian Dröge
parent ec32124cf0
commit 0ef2a41d84

View file

@ -802,19 +802,17 @@ gst_hls_demux_handle_buffer (GstAdaptiveDemux * demux,
{
GstHLSDemuxStream *hls_stream = GST_HLS_DEMUX_STREAM_CAST (stream); // FIXME: pass HlsStream into function
GstHLSDemux *hlsdemux = GST_HLS_DEMUX_CAST (demux);
GstMapInfo info;
GstClockTime first_pcr, last_pcr;
GstTagList *tags;
if (buffer == NULL)
return GST_FLOW_OK;
gst_buffer_map (buffer, &info, GST_MAP_READ);
if (G_UNLIKELY (hls_stream->do_typefind)) {
GstCaps *caps = NULL;
guint buffer_size;
GstTypeFindProbability prob = GST_TYPE_FIND_NONE;
GstMapInfo info;
if (hls_stream->pending_typefind_buffer)
buffer = gst_buffer_append (hls_stream->pending_typefind_buffer, buffer);
@ -859,10 +857,10 @@ gst_hls_demux_handle_buffer (GstAdaptiveDemux * demux,
gst_adaptive_demux_stream_set_caps (stream, caps);
hls_stream->do_typefind = FALSE;
}
g_assert (hls_stream->pending_typefind_buffer == NULL);
gst_buffer_unmap (buffer, &info);
}
g_assert (hls_stream->pending_typefind_buffer == NULL);
// Accumulate this buffer
if (hls_stream->pending_pcr_buffer) {