diff options
author | Michael Smith <msmith@songbirdnest.com> | 2009-10-27 14:31:39 -0700 |
---|---|---|
committer | Michael Smith <msmith@songbirdnest.com> | 2009-10-27 14:32:30 -0700 |
commit | 29fe6205ca9f756a8838994461fb018639457da8 (patch) | |
tree | d61448eb2ea6b4a35f6ec04c2634eacc9c893e52 /gst | |
parent | 63734cbb3c1c4c2c4e20ce90a05c1dae91e3be2b (diff) | |
download | gstreamer-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')
-rw-r--r-- | gst/id3tag/id3tag.c | 9 |
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 { |