mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
jpegparse: avoid leaking converted comment string
This commit is contained in:
parent
ec300d007d
commit
2056f4a633
1 changed files with 3 additions and 2 deletions
|
@ -562,7 +562,7 @@ gst_jpeg_parse_read_header (GstJpegParse * parse, GstBuffer * buffer)
|
|||
|
||||
case COM:{ /* read comment and post as tag */
|
||||
const guint8 *comment = NULL;
|
||||
const gchar *comm;
|
||||
gchar *comm;
|
||||
const gchar *env_vars[] = { "GST_JPEG_TAG_ENCODING",
|
||||
"GST_TAG_ENCODING", NULL
|
||||
};
|
||||
|
@ -572,7 +572,7 @@ gst_jpeg_parse_read_header (GstJpegParse * parse, GstBuffer * buffer)
|
|||
if (!gst_byte_reader_get_data (&reader, size - 2, &comment))
|
||||
goto error;
|
||||
|
||||
comm = (const gchar *) comment;
|
||||
comm = (gchar *) comment;
|
||||
comm = gst_tag_freeform_string_to_utf8 (comm, size - 2, env_vars);
|
||||
|
||||
if (comm) {
|
||||
|
@ -580,6 +580,7 @@ gst_jpeg_parse_read_header (GstJpegParse * parse, GstBuffer * buffer)
|
|||
parse->priv->tags = gst_tag_list_new ();
|
||||
gst_tag_list_add (parse->priv->tags, GST_TAG_MERGE_REPLACE,
|
||||
GST_TAG_COMMENT, comm, NULL);
|
||||
g_free (comm);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue