tsdemux: Make sure we have a language code before using it
authorEdward Hervey <edward.hervey@collabora.co.uk>
Sat, 26 May 2012 12:57:23 +0000 (14:57 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Sat, 26 May 2012 13:54:48 +0000 (15:54 +0200)
gst/mpegtsdemux/tsdemux.c

index 6d2ae3db7cadf29335d17701b7331d9389cfc1d0..2a7a7de3234c0c3669b963b6f1b4d647e0efae67 100644 (file)
@@ -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];