From 9c3516116a50750371afa4c26c6a32f5d22d246a Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 9 Nov 2011 10:32:06 +0100 Subject: [PATCH] qtdemux: minimal sanity check on creation datetime --- gst/isomp4/qtdemux.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 1b7caf3..ddf4348 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -8830,8 +8830,16 @@ qtdemux_parse_tree (GstQTDemux * qtdemux) /* Moving qt creation time (secs since 1904) to unix time */ if (creation_time != 0) { if (creation_time > QTDEMUX_SECONDS_FROM_1904_TO_1970) { + GTimeVal now; + creation_time -= QTDEMUX_SECONDS_FROM_1904_TO_1970; - datetime = gst_date_time_new_from_unix_epoch_local_time (creation_time); + /* some data cleansing sanity */ + g_get_current_time (&now); + if (now.tv_sec + 24 * 3600 < creation_time) { + GST_DEBUG_OBJECT (qtdemux, "discarding bogus future creation time"); + } else { + datetime = gst_date_time_new_from_unix_epoch_local_time (creation_time); + } } else { GST_WARNING_OBJECT (qtdemux, "Can't handle datetimes before 1970 yet, " "please file a bug at http://bugzilla.gnome.org"); -- 2.7.4