summaryrefslogtreecommitdiffstats
path: root/gst/qtdemux
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2009-07-01 13:07:48 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-07-01 13:07:48 +0100
commit2bcf52dde786c745466dbe6eaa7b93b0129af827 (patch)
tree831bb477c77cd6b6b44e38ec305c0f9ff171a24c /gst/qtdemux
parentf6a12114953214d65560b084197362e814376d17 (diff)
qtdemux: error out instead of dividing by 0
Error out if timescale is 0.
Diffstat (limited to 'gst/qtdemux')
-rw-r--r--gst/qtdemux/qtdemux.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index eafaef8f..f62419e6 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -3585,7 +3585,7 @@ qtdemux_parse_samples (GstQTDemux * qtdemux, QtDemuxStream * stream,
}
}
/* fill up empty timestamps with the last timestamp, this can happen when
- * the last samples do not decoder and so we don't have timestamps for them.
+ * the last samples do not decode and so we don't have timestamps for them.
* We however look at the last timestamp to estimate the track length so we
* need something in here. */
for (; index < n_samples; index++) {
@@ -3971,6 +3971,9 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
GST_LOG_OBJECT (qtdemux, "track duration: %" G_GUINT64_FORMAT,
stream->duration);
+ if (G_UNLIKELY (stream->timescale == 0 || qtdemux->timescale == 0))
+ goto corrupt_file;
+
if (qtdemux->duration != G_MAXINT32 && stream->duration != G_MAXINT32) {
guint64 tdur1, tdur2;