From 34164610b09a61e549c76b69cea8d8efcfd494f5 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 4 Jul 2013 07:48:10 +0200 Subject: [PATCH] mpegtsdescriptor: Fix handling of unknown stream encodings If we cannot identify the encoding used for a string, return a NULL string instead of garbage and add a FIXME so we can detect and later fix it. --- gst-libs/gst/mpegts/gstmpegtsdescriptor.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gst-libs/gst/mpegts/gstmpegtsdescriptor.c b/gst-libs/gst/mpegts/gstmpegtsdescriptor.c index 56e74366a6..9850b307b0 100644 --- a/gst-libs/gst/mpegts/gstmpegtsdescriptor.c +++ b/gst-libs/gst/mpegts/gstmpegtsdescriptor.c @@ -376,11 +376,9 @@ get_encoding_and_convert (const gchar * text, guint length) if (__iconvs[encoding] == ((GIConv) - 1)) __iconvs[encoding] = g_iconv_open ("utf-8", iconvtablename[encoding]); giconv = __iconvs[encoding]; - } - - if (giconv == ((GIConv) - 1)) { - GST_WARNING ("Could not detect encoding"); - converted_str = g_strndup (text, length); + } else { + GST_FIXME ("Could not detect encoding. Returning NULL string"); + converted_str = NULL; goto beach; }