From 54341f0c483279ea377c578ca72149b20eea317a Mon Sep 17 00:00:00 2001 From: TangoCash Date: Fri, 10 Nov 2017 11:32:58 +0100 Subject: [PATCH] gstreamer playback: fix possible segfault --- libarmbox/playback_gst.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index 4ead545..f11728a 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -948,9 +948,9 @@ void cPlayback::FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *nu //(ac3flags[i] > 2) ? ac3flags[i] = 1 : ac3flags[i] = 0; g_signal_emit_by_name (m_gst_playbin, "get-audio-tags", i, &tags); - if (tags && GST_IS_TAG_LIST(tags)) + if (tags) { - if (gst_tag_list_get_string(tags, GST_TAG_LANGUAGE_CODE, &g_lang)) + if (GST_IS_TAG_LIST(tags) && gst_tag_list_get_string(tags, GST_TAG_LANGUAGE_CODE, &g_lang)) { std::string slang; if (gst_tag_check_language_code(g_lang)) @@ -1030,6 +1030,9 @@ void cPlayback::GetMetadata(std::vector &keys, std::vector