tag: ignore malformed ID3v2 TDAT frames

Just skip them, don't cause criticals.

https://bugzilla.gnome.org/show_bug.cgi?id=703283
This commit is contained in:
Marcin Lewandowski 2013-07-05 00:47:08 +01:00 committed by Tim-Philipp Müller
parent ba32b2e16b
commit cd00206059

View file

@ -695,11 +695,21 @@ parse_obsolete_tdat_frame (ID3TagsWorking * work)
g_ascii_isdigit (work->parse_data[2]) &&
g_ascii_isdigit (work->parse_data[3]) &&
g_ascii_isdigit (work->parse_data[4])) {
work->pending_day = (10 * g_ascii_digit_value (work->parse_data[1])) +
guint pending_day = (10 * g_ascii_digit_value (work->parse_data[1])) +
g_ascii_digit_value (work->parse_data[2]);
work->pending_month = (10 * g_ascii_digit_value (work->parse_data[3])) +
guint pending_month = (10 * g_ascii_digit_value (work->parse_data[3])) +
g_ascii_digit_value (work->parse_data[4]);
GST_LOG ("date (dd/mm) %02u/%02u", work->pending_day, work->pending_month);
if (pending_day >= 1 && pending_day <= 31 && pending_month >= 1
&& pending_month <= 12) {
GST_LOG ("date (dd/mm) %02u/%02u", pending_day, pending_month);
work->pending_day = pending_day;
work->pending_month = pending_month;
} else {
GST_WARNING ("Ignoring invalid ID3v2 TDAT frame (dd/mm) %02u/%02u",
pending_day, pending_month);
}
}
}