summaryrefslogtreecommitdiff
path: root/gst/mpegtsparse
diff options
context:
space:
mode:
authorSebastian Pölsterl <marduk@k-d-w.org>2008-06-20 16:54:28 +0000
committerZaheer Abbas Merali <zaheerabbas@merali.org>2008-06-20 16:54:28 +0000
commit15f2d610f0e57210e8e0567bb825526f025dea51 (patch)
tree96165485dab51b636ea4db702996f35c079f7626 /gst/mpegtsparse
parent25442736e52662be97d93cbde71a713f6a3b8a60 (diff)
downloadgstreamer-plugins-bad-15f2d610f0e57210e8e0567bb825526f025dea51.tar.gz
gst/mpegtsparse/mpegtspacketizer.c: Fix problem when empty string is provided.
Original commit message from CVS: Patch by: Sebastian Pölsterl * gst/mpegtsparse/mpegtspacketizer.c: Fix problem when empty string is provided.
Diffstat (limited to 'gst/mpegtsparse')
-rw-r--r--gst/mpegtsparse/mpegtspacketizer.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gst/mpegtsparse/mpegtspacketizer.c b/gst/mpegtsparse/mpegtspacketizer.c
index 3b108f991..99d04c72f 100644
--- a/gst/mpegtsparse/mpegtspacketizer.c
+++ b/gst/mpegtsparse/mpegtspacketizer.c
@@ -2183,9 +2183,13 @@ convert_to_utf8 (const gchar * text, gint length, guint start,
}
}
- new_text =
- g_convert ((gchar *) sb->data, sb->len, "utf-8", encoding, NULL, NULL,
- error);
+ if (sb->len > 0) {
+ new_text =
+ g_convert ((gchar *) sb->data, sb->len, "utf-8", encoding, NULL, NULL,
+ error);
+ } else {
+ new_text = g_strdup ("");
+ }
g_byte_array_free (sb, TRUE);
@@ -2201,6 +2205,8 @@ get_encoding_and_convert (const gchar * text, guint length)
guint start_text = 0;
gboolean is_multibyte;
+ g_return_val_if_fail (text != NULL, NULL);
+
encoding = get_encoding (text, &start_text, &is_multibyte);
if (encoding == NULL) {