From 1b0f13ebf28d6deb774dfeffe615152c1e3065c2 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Thu, 10 Apr 2014 10:25:46 +0100 Subject: [PATCH] oggmux: test for failure to return tag It should really not happen unless the tag list it corrupt, but the API returns a failure code so we may as well use it. Coverity 1139595 --- ext/ogg/gstoggmux.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index a540420bb0..3b352e9406 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -1287,9 +1287,13 @@ gst_ogg_mux_add_fisbone_message_header_from_tags (GstOggMux * mux, gchar *tmp; if (n) g_string_append (s, ", "); - gst_tag_list_get_string_index (tags, tag, n, &tmp); - g_string_append (s, tmp); - g_free (tmp); + if (gst_tag_list_get_string_index (tags, tag, n, &tmp)) { + g_string_append (s, tmp); + g_free (tmp); + } else { + GST_WARNING_OBJECT (mux, "Tag %s index %u was not found (%u total)", tag, + n, size); + } } gst_ogg_mux_add_fisbone_message_header (mux, bw, header, s->str); g_string_free (s, TRUE);