gstreamer playback: fix possible segfault

Origin commit data
------------------
Branch: master
Commit: 3e28504ef3
Author: TangoCash <eric@loxat.de>
Date: 2017-11-10 (Fri, 10 Nov 2017)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
TangoCash
2017-11-10 11:32:58 +01:00
parent 7b39a406ab
commit 8fc449b5ed

View File

@@ -951,9 +951,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))
@@ -1033,6 +1033,9 @@ void cPlayback::GetMetadata(std::vector<std::string> &keys, std::vector<std::str
val = gst_tag_list_get_value_index(m_stream_tags, name, j);
if (val == NULL)
continue;
if (G_VALUE_HOLDS_STRING(val))
{
keys.push_back(name);