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.
This commit is contained in:
Sebastian Pölsterl 2008-06-20 16:54:28 +00:00 committed by Zaheer Abbas Merali
parent 25442736e5
commit 15f2d610f0
2 changed files with 16 additions and 3 deletions

View file

@ -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),

View file

@ -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) {