+2007-02-25 Tim-Philipp Müller <tim at centricular dot net>
+
+ Patch by: René Stadler <mail at renestadler de>
+
+ * gst-libs/gst/tag/gstvorbistag.c: (gst_vorbis_tag_add):
+ Parse date strings in vorbis comments that have an invalid (zero)
+ month or day (#410396).
+
+ * tests/check/libs/tag.c: (GST_START_TEST):
+ Test case for the above.
+
2007-02-24 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Loïc Minier <lool+gnome at via ecp fr>
}
}
+ if (y != 0 && m == 0 && d == 0) {
+ /* accept dates of the form 2007-00-00 as 2007-01-01 */
+ m = 1;
+ d = 1;
+ }
+
/* date might be followed by a time */
if ((*check == '\0' || g_ascii_isspace (*check)) && y != 0 &&
g_date_valid_dmy (d, m, y)) {
g_date_free (date);
gst_tag_list_free (list);
}
+
+ /* check date with month/day of 00-00 */
+ {
+ GDate *date = NULL;
+
+ list = gst_tag_list_new ();
+ gst_vorbis_tag_add (list, "DATE", "1992-00-00");
+
+ fail_unless (gst_tag_list_get_date_index (list, GST_TAG_DATE, 0, &date));
+ fail_unless (date != NULL);
+ fail_unless (g_date_get_year (date) == 1992);
+
+ g_date_free (date);
+ gst_tag_list_free (list);
+ }
}
GST_END_TEST;