mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
avidemux: Avoid potential double-free
stream->name was being freed (without being NULL-ed) before we were certain it would be set again. CID #1456071 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/582>
This commit is contained in:
parent
518d192dc5
commit
619457ae26
1 changed files with 8 additions and 3 deletions
|
@ -2227,7 +2227,8 @@ gst_avi_demux_parse_stream (GstAviDemux * avi, GstBuffer * buf)
|
|||
}
|
||||
break;
|
||||
case GST_RIFF_TAG_strn:
|
||||
g_free (stream->name);
|
||||
{
|
||||
gchar *stream_name = NULL;
|
||||
|
||||
gst_buffer_map (sub, &map, GST_MAP_READ);
|
||||
|
||||
|
@ -2237,12 +2238,16 @@ gst_avi_demux_parse_stream (GstAviDemux * avi, GstBuffer * buf)
|
|||
map.data, map.size);
|
||||
|
||||
if (gst_tag_list_get_string (avi->globaltags, GST_TAG_TITLE,
|
||||
&stream->name))
|
||||
GST_DEBUG_OBJECT (avi, "stream name: %s", stream->name);
|
||||
&stream_name)) {
|
||||
GST_DEBUG_OBJECT (avi, "stream name: %s", stream_name);
|
||||
g_free (stream->name);
|
||||
stream->name = stream_name;
|
||||
}
|
||||
|
||||
gst_buffer_unmap (sub, &map);
|
||||
gst_buffer_unref (sub);
|
||||
sub = NULL;
|
||||
}
|
||||
break;
|
||||
case GST_RIFF_IDIT:
|
||||
gst_avi_demux_parse_idit (avi, sub);
|
||||
|
|
Loading…
Reference in a new issue