diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 036e509c33..99564e828e 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -317,7 +317,7 @@ struct _QtDemuxStream guint32 stts_samples; guint32 n_sample_times; guint32 stts_sample_index; - guint32 stts_time; + guint64 stts_time; guint32 stts_duration; /* stss */ gboolean stss_present; @@ -5623,8 +5623,8 @@ done2: for (i = stream->stts_index; i < n_sample_times; i++) { guint32 stts_samples; - guint32 stts_duration; - guint32 stts_time; + gint32 stts_duration; + gint64 stts_time; if (stream->stts_sample_index >= stream->stts_samples || !stream->stts_sample_index) { @@ -5654,7 +5654,9 @@ done2: cur->timestamp = stts_time; cur->duration = stts_duration; - stts_time += stts_duration; + /* avoid 32-bit wrap-around, + * but still mind possible 'negative' duration */ + stts_time += (gint64) stts_duration; cur++; if (G_UNLIKELY (cur > last)) {