* @datetime: a #GstDateTime
*
* Returns the year of this #GstDateTime
- * Call gst_date_time_has_year before, to avoid warnings.
+ * Call gst_date_time_has_year() before, to avoid warnings.
*
* Return value: The year of this #GstDateTime
*/
* @datetime: a #GstDateTime
*
* Returns the month of this #GstDateTime. January is 1, February is 2, etc..
- * Call gst_date_time_has_month before, to avoid warnings.
+ * Call gst_date_time_has_month() before, to avoid warnings.
*
* Return value: The month of this #GstDateTime
*/
* @datetime: a #GstDateTime
*
* Returns the day of the month of this #GstDateTime.
- * Call gst_date_time_has_day before, to avoid warnings.
+ * Call gst_date_time_has_day() before, to avoid warnings.
*
* Return value: The day of this #GstDateTime
*/
*
* Retrieves the hour of the day represented by @datetime in the gregorian
* calendar. The return is in the range of 0 to 23.
- * Call gst_date_time_has_haur before, to avoid warnings.
+ * Call gst_date_time_has_time() before, to avoid warnings.
*
* Return value: the hour of the day
*/
*
* Retrieves the minute of the hour represented by @datetime in the gregorian
* calendar.
- * Call gst_date_time_has_minute before, to avoid warnings.
+ * Call gst_date_time_has_time() before, to avoid warnings.
*
* Return value: the minute of the hour
*/
*
* Retrieves the second of the minute represented by @datetime in the gregorian
* calendar.
- * Call gst_date_time_has_second before, to avoid warnings.
+ * Call gst_date_time_has_time() before, to avoid warnings.
*
* Return value: the second represented by @datetime
*/
month = day = -1;
}
- if (ret >= 1 && year <= 0)
+ if (ret >= 1 && (year <= 0 || year > 9999 || month > 12 || day > 31))
return NULL;
else if (ret >= 1 && len < 16)
else if (neg_pos)
pos = neg_pos + 1;
- if (pos) {
+ if (pos && strlen (pos) >= 3) {
gint ret_tz;
if (pos[2] == ':')
ret_tz = sscanf (pos, "%d:%d", &gmt_offset_hour, &gmt_offset_min);
gst_date_time_free (GstDateTime * datetime)
{
g_date_time_unref (datetime->datetime);
+
+#ifdef USE_POISONING
+ memset (datetime, 0xff, sizeof (GstDateTime));
+#endif
+
g_slice_free (GstDateTime, datetime);
}