mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
metadata: don't copy trailing NULL of strings in xmp metadata
Also useing g_strdup, fixes the malloc <-> g_free mismatch.
This commit is contained in:
parent
b7b8b7f407
commit
27683ead16
1 changed files with 3 additions and 4 deletions
|
@ -385,11 +385,10 @@ metadatamux_xmp_create_chunk_from_tag_list (guint8 ** buf, guint32 * size,
|
|||
if (!xmp_serialize (xmp, xmp_str_buf, 0, 2)) {
|
||||
GST_ERROR ("failed to serialize xmp into chunk\n");
|
||||
} else if (xmp_str_buf) {
|
||||
unsigned int len = strlen (xmp_string_cstr (xmp_str_buf));
|
||||
const gchar *text = xmp_string_cstr (xmp_str_buf);
|
||||
|
||||
*size = len + 1;
|
||||
*buf = malloc (*size);
|
||||
memcpy (*buf, xmp_string_cstr (xmp_str_buf), *size);
|
||||
*buf = (guint8 *) g_strdup (text);
|
||||
*size = strlen (text);
|
||||
} else {
|
||||
GST_ERROR ("failed to serialize xmp into chunk\n");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue