mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-17 05:46:36 +00:00
id3mux: glib doesn't reliably null-terminate wide-character encodings in
g_convert, so write the null-terminator separately and explicitly.
This commit is contained in:
parent
63734cbb3c
commit
29fe6205ca
1 changed files with 5 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue