summaryrefslogtreecommitdiff
path: root/gst/id3tag
diff options
context:
space:
mode:
authorMichael Smith <msmith@songbirdnest.com>2009-10-27 14:31:39 -0700
committerMichael Smith <msmith@songbirdnest.com>2009-10-27 14:32:30 -0700
commit29fe6205ca9f756a8838994461fb018639457da8 (patch)
treed61448eb2ea6b4a35f6ec04c2634eacc9c893e52 /gst/id3tag
parent63734cbb3c1c4c2c4e20ce90a05c1dae91e3be2b (diff)
downloadgstreamer-plugins-bad-29fe6205ca9f756a8838994461fb018639457da8.tar.gz
id3mux: glib doesn't reliably null-terminate wide-character encodings in
g_convert, so write the null-terminator separately and explicitly.
Diffstat (limited to 'gst/id3tag')
-rw-r--r--gst/id3tag/id3tag.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gst/id3tag/id3tag.c b/gst/id3tag/id3tag.c
index 07633343a..899bd4be2 100644
--- a/gst/id3tag/id3tag.c
+++ b/gst/id3tag/id3tag.c
@@ -374,10 +374,11 @@ id3v2_frame_write_string (GstId3v2Frame * frame, int encoding,
/* Write the BOM */
id3v2_frame_write_bytes (frame, (const guint8 *) bom, 2);
- /* NUL terminator is 2 bytes, if present */
- terminator_length = null_terminate ? 2 : 0;
- id3v2_frame_write_bytes (frame, (const guint8 *) utf16,
- utf16len + terminator_length);
+ id3v2_frame_write_bytes (frame, (const guint8 *) utf16, utf16len);
+ if (null_terminate) {
+ /* NUL terminator is 2 bytes, if present. */
+ id3v2_frame_write_uint16 (frame, 0);
+ }
g_free (utf16);
} else {