mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
gst/id3demux/id3v2frames.c: Fix parsing of numeric genre strings some more, by ensuring that we only try and parse st...
Original commit message from CVS: * gst/id3demux/id3v2frames.c: (id3v2_genre_fields_to_taglist): Fix parsing of numeric genre strings some more, by ensuring that we only try and parse strings that a) Start with '(' and b) Consist only of digits. Also, when finding an escaping '((' sequence, bust it back to '(' by swallowing the first parenthesis
This commit is contained in:
parent
d2bd5e45bd
commit
85c6182ef4
2 changed files with 26 additions and 2 deletions
|
@ -1,3 +1,12 @@
|
|||
2006-05-10 Jan Schmidt <thaytan@mad.scientist.com>
|
||||
|
||||
* gst/id3demux/id3v2frames.c: (id3v2_genre_fields_to_taglist):
|
||||
Fix parsing of numeric genre strings some more, by ensuring that
|
||||
we only try and parse strings that a) Start with '(' and b) Consist
|
||||
only of digits.
|
||||
Also, when finding an escaping '((' sequence, bust it back to '(' by
|
||||
swallowing the first parenthesis
|
||||
|
||||
2006-05-10 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* ext/esd/esdsink.c: (gst_esdsink_finalize), (gst_esdsink_getcaps),
|
||||
|
|
|
@ -622,8 +622,17 @@ id3v2_genre_fields_to_taglist (ID3TagsWorking * work, const gchar * tag_name,
|
|||
gint pos;
|
||||
gboolean found = FALSE;
|
||||
|
||||
/* Double parenthesis ends the numeric genres */
|
||||
if (tag_str[0] == '(' && tag_str[1] == '(')
|
||||
/* Double parenthesis ends the numeric genres, but we need
|
||||
* to swallow the first one so we actually output '(' */
|
||||
if (tag_str[0] == '(' && tag_str[1] == '(') {
|
||||
tag_str++;
|
||||
len--;
|
||||
break;
|
||||
}
|
||||
|
||||
/* If the first char is not a parenthesis, then stop
|
||||
* looking for parenthesised genre strings */
|
||||
if (tag_str[0] != '(')
|
||||
break;
|
||||
|
||||
for (pos = 1; pos < len; pos++) {
|
||||
|
@ -640,6 +649,12 @@ id3v2_genre_fields_to_taglist (ID3TagsWorking * work, const gchar * tag_name,
|
|||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* If we encounter a non-digit while searching for a closing
|
||||
* parenthesis, we should not try and interpret this as a
|
||||
* numeric genre string */
|
||||
if (!g_ascii_isdigit (tag_str[pos]))
|
||||
break;
|
||||
}
|
||||
if (!found)
|
||||
break; /* There was no closing parenthesis */
|
||||
|
|
Loading…
Reference in a new issue