From 7111e0092d91714c1559a78b5f19c60a282bc39a Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Thu, 30 Jan 2003 20:12:18 +0000 Subject: [PATCH] Fix bug 104344 and add a missing free() Original commit message from CVS: Fix bug 104344 and add a missing free() --- ext/mad/gstmad.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ext/mad/gstmad.c b/ext/mad/gstmad.c index e1dbac11a1..7b69cd3410 100644 --- a/ext/mad/gstmad.c +++ b/ext/mad/gstmad.c @@ -909,7 +909,7 @@ id3_to_caps(struct id3_tag const *tag) unsigned int i; struct id3_frame const *frame; id3_ucs4_t const *ucs4; - id3_latin1_t *latin1; + id3_utf8_t *utf8; GstProps *props; GstPropsEntry *entry; GstCaps *caps; @@ -965,13 +965,13 @@ id3_to_caps(struct id3_tag const *tag) if (strcmp(info[i].id, ID3_FRAME_GENRE) == 0) ucs4 = id3_genre_name(ucs4); - latin1 = id3_ucs4_latin1duplicate(ucs4); - if (latin1 == 0) + utf8 = id3_ucs4_utf8duplicate(ucs4); + if (utf8 == 0) goto fail; - entry = gst_props_entry_new (name, GST_PROPS_STRING_TYPE, latin1); + entry = gst_props_entry_new (name, GST_PROPS_STRING_TYPE, utf8); values = g_list_prepend (values, entry); - free(latin1); + free(utf8); } if (values) { values = g_list_reverse (values); @@ -1000,12 +1000,13 @@ id3_to_caps(struct id3_tag const *tag) ucs4 = id3_field_getfullstring(&frame->fields[3]); g_assert(ucs4); - latin1 = id3_ucs4_latin1duplicate(ucs4); - if (latin1 == 0) + utf8 = id3_ucs4_utf8duplicate(ucs4); + if (utf8 == 0) goto fail; - entry = gst_props_entry_new ("Comment", GST_PROPS_STRING_TYPE, latin1); + entry = gst_props_entry_new ("Comment", GST_PROPS_STRING_TYPE, utf8); values = g_list_prepend (values, entry); + free(utf8); } if (values) { values = g_list_reverse (values);