From c6acd6368b145209dba809036f9eb89a58addb00 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Wed, 16 Apr 2014 17:04:50 +0100 Subject: [PATCH] avidemux: remove dead code sub may not be NULL in this switch, there is a bail out just before it if so. Coverity 206098 --- gst/avi/gstavidemux.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 37306d832a..7ffa57dbe2 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -2023,6 +2023,7 @@ gst_avi_demux_parse_stream (GstAviDemux * avi, GstBuffer * buf) gst_riff_vprp *vprp = NULL; GstEvent *event; gchar *stream_id; + GstMapInfo map; element = GST_ELEMENT_CAST (avi); @@ -2216,22 +2217,17 @@ gst_avi_demux_parse_stream (GstAviDemux * avi, GstBuffer * buf) break; case GST_RIFF_TAG_strn: g_free (stream->name); - if (sub != NULL) { - GstMapInfo map; - gst_buffer_map (sub, &map, GST_MAP_READ); - stream->name = g_strndup ((gchar *) map.data, map.size); - gst_buffer_unmap (sub, &map); - gst_buffer_unref (sub); - sub = NULL; + gst_buffer_map (sub, &map, GST_MAP_READ); + stream->name = g_strndup ((gchar *) map.data, map.size); + gst_buffer_unmap (sub, &map); + gst_buffer_unref (sub); + sub = NULL; - if (avi->globaltags == NULL) - avi->globaltags = gst_tag_list_new_empty (); - gst_tag_list_add (avi->globaltags, GST_TAG_MERGE_REPLACE, - GST_TAG_TITLE, stream->name, NULL); - } else { - stream->name = g_strdup (""); - } + if (avi->globaltags == NULL) + avi->globaltags = gst_tag_list_new_empty (); + gst_tag_list_add (avi->globaltags, GST_TAG_MERGE_REPLACE, + GST_TAG_TITLE, stream->name, NULL); GST_DEBUG_OBJECT (avi, "stream name: %s", stream->name); break; case GST_RIFF_IDIT: