summaryrefslogtreecommitdiffstats
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
parent25442736e52662be97d93cbde71a713f6a3b8a60 (diff)
downloadgst-plugins-bad-15f2d610f0e57210e8e0567bb825526f025dea51.tar.gz
gst-plugins-bad-15f2d610f0e57210e8e0567bb825526f025dea51.tar.bz2
gst-plugins-bad-15f2d610f0e57210e8e0567bb825526f025dea51.zip
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.
-rw-r--r--ChangeLog7
-rw-r--r--gst/mpegtsparse/mpegtspacketizer.c12
2 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 59abd0de..7ad64925 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-20 Zaheer Abbas Merali <zaheerabbas at merali dot org>
+
+ Patch by: Sebastian Pölsterl
+
+ * gst/mpegtsparse/mpegtspacketizer.c:
+ Fix problem when empty string is provided.
+
2008-06-20 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* gst/deinterlace2/tvtime/vfir.c: (deinterlace_line_mmxext),
diff --git a/gst/mpegtsparse/mpegtspacketizer.c b/gst/mpegtsparse/mpegtspacketizer.c
index 3b108f99..99d04c72 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) {