apedemux: Skip empty tags
Avoid creating bogus string tags. Also added logging of the string values of the tag name and value.
This commit is contained in:
parent
c0bd590ce3
commit
c6c941f315
@ -197,10 +197,16 @@ ape_demux_parse_tags (const guint8 * data, gint size)
|
|||||||
if (size - n < len)
|
if (size - n < len)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* If the tag is empty, skip to the next one */
|
||||||
|
if (len == 0)
|
||||||
|
goto next_tag;
|
||||||
|
|
||||||
/* read */
|
/* read */
|
||||||
tag = g_strndup ((gchar *) data + 8, n - 9);
|
tag = g_strndup ((gchar *) data + 8, n - 9);
|
||||||
val = g_strndup ((gchar *) data + n, len);
|
val = g_strndup ((gchar *) data + n, len);
|
||||||
|
|
||||||
|
GST_LOG ("tag [%s], val[%s]", tag, val);
|
||||||
|
|
||||||
/* special-case 'media' tag, could be e.g. "CD 1/2" */
|
/* special-case 'media' tag, could be e.g. "CD 1/2" */
|
||||||
if (g_ascii_strcasecmp (tag, "media") == 0) {
|
if (g_ascii_strcasecmp (tag, "media") == 0) {
|
||||||
gchar *sp, *sp2;
|
gchar *sp, *sp2;
|
||||||
@ -314,6 +320,7 @@ ape_demux_parse_tags (const guint8 * data, gint size)
|
|||||||
g_free (val);
|
g_free (val);
|
||||||
|
|
||||||
/* move data pointer */
|
/* move data pointer */
|
||||||
|
next_tag:
|
||||||
size -= len + n;
|
size -= len + n;
|
||||||
data += len + n;
|
data += len + n;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user