From 17d9447ea59094a8bc11661173cd9fa486c2411a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 4 Apr 2011 10:01:26 +0200 Subject: [PATCH] qtdemux: Year 0 is not a valid year for GDate and the proleptic gregorian calendar --- gst/qtdemux/qtdemux.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index b043920..63871a5 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -5233,7 +5233,7 @@ qtdemux_stbl_init (GstQTDemux * qtdemux, QtDemuxStream * stream, GNode * stbl) /* sync sample atom */ stream->stps_present = FALSE; if ((stream->stss_present = - !!qtdemux_tree_get_child_by_type_full (stbl, FOURCC_stss, + ! !qtdemux_tree_get_child_by_type_full (stbl, FOURCC_stss, &stream->stss) ? TRUE : FALSE) == TRUE) { /* copy atom data into a new buffer for later use */ stream->stss.data = g_memdup (stream->stss.data, stream->stss.size); @@ -5251,7 +5251,7 @@ qtdemux_stbl_init (GstQTDemux * qtdemux, QtDemuxStream * stream, GNode * stbl) /* partial sync sample atom */ if ((stream->stps_present = - !!qtdemux_tree_get_child_by_type_full (stbl, FOURCC_stps, + ! !qtdemux_tree_get_child_by_type_full (stbl, FOURCC_stps, &stream->stps) ? TRUE : FALSE) == TRUE) { /* copy atom data into a new buffer for later use */ stream->stps.data = g_memdup (stream->stps.data, stream->stps.size); @@ -5370,7 +5370,7 @@ qtdemux_stbl_init (GstQTDemux * qtdemux, QtDemuxStream * stream, GNode * stbl) /* composition time-to-sample */ if ((stream->ctts_present = - !!qtdemux_tree_get_child_by_type_full (stbl, FOURCC_ctts, + ! !qtdemux_tree_get_child_by_type_full (stbl, FOURCC_ctts, &stream->ctts) ? TRUE : FALSE) == TRUE) { /* copy atom data into a new buffer for later use */ stream->ctts.data = g_memdup (stream->ctts.data, stream->ctts.size); @@ -7557,6 +7557,10 @@ qtdemux_tag_add_year (GstQTDemux * qtdemux, const char *tag, const char *dummy, return; y = QT_UINT16 ((guint8 *) node->data + 12); + if (y == 0) { + GST_DEBUG_OBJECT (qtdemux, "year: %u is not a valid year", y); + return; + } GST_DEBUG_OBJECT (qtdemux, "year: %u", y); date = g_date_new_dmy (1, 1, y); -- 2.7.4