From 8aa64c5d7d5c0f96d90f8b54a81a701aed10e9e7 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Sat, 26 May 2012 14:57:23 +0200 Subject: [PATCH] tsdemux: Make sure we have a language code before using it --- gst/mpegtsdemux/tsdemux.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 6d2ae3db7c..2a7a7de323 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -645,6 +645,11 @@ gst_ts_demux_create_tags (TSDemuxStream * stream) language_n = (gchar *) DESC_ISO_639_LANGUAGE_language_code_nth (desc, i); + /* Language codes should be 3 character long, we allow + * a bit more flexibility by allowing 2 characters. */ + if (!language_n[0] || !language_n[1]) + continue; + GST_LOG ("Add language code for stream: %s", language_n); lang_code[0] = language_n[0]; -- 2.34.1