gst/gstvalue.c: check for validity of dates

Original commit message from CVS:
* gst/gstvalue.c: (gst_value_set_date), (gst_date_copy):
check for validity of dates
This commit is contained in:
Stefan Kost 2006-10-18 08:54:30 +00:00
parent bac9f9f0b2
commit d3da3ed47b
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2006-10-18 Stefan Kost <ensonic@users.sf.net>
* gst/gstvalue.c: (gst_value_set_date), (gst_date_copy):
check for validity of dates
2006-10-17 Tim-Philipp Müller <tim at centricular dot net>
* docs/gst/gstreamer-sections.txt:

View file

@ -3726,6 +3726,7 @@ void
gst_value_set_date (GValue * value, const GDate * date)
{
g_return_if_fail (G_VALUE_TYPE (value) == GST_TYPE_DATE);
g_return_if_fail (g_date_valid (date));
g_value_set_boxed (value, date);
}
@ -3751,6 +3752,11 @@ gst_date_copy (gpointer boxed)
{
const GDate *date = (const GDate *) boxed;
if (!g_date_valid (date)) {
GST_WARNING ("invalid GDate");
return NULL;
}
return g_date_new_julian (g_date_get_julian (date));
}