summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-09-13 20:13:32 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-09-13 20:13:32 +0000
commit84f449bd4b4553798c1210d8f4a9f9e59fb50c2c (patch)
tree358f0738389d5312c61016b0d461902939daa215 /gst
parentfe20ee421865cc8a7a98b2eaaa60fa288a0f527c (diff)
downloadgst-plugins-bad-84f449bd4b4553798c1210d8f4a9f9e59fb50c2c.tar.gz
gst-plugins-bad-84f449bd4b4553798c1210d8f4a9f9e59fb50c2c.tar.bz2
gst-plugins-bad-84f449bd4b4553798c1210d8f4a9f9e59fb50c2c.zip
gst/qtdemux/qtdemux.c: Don't crash by dividing by zero (see sample movie in #126922).
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (gst_qtdemux_add_stream), (qtdemux_parse_trak): Don't crash by dividing by zero (see sample movie in #126922).
Diffstat (limited to 'gst')
-rw-r--r--gst/qtdemux/qtdemux.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index e4a54f07..1abaf0f2 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -850,7 +850,8 @@ gst_qtdemux_add_stream (GstQTDemux * qtdemux, QtDemuxStream * stream)
g_print ("setting caps %s\n", gst_caps_to_string (stream->caps));
gst_pad_set_explicit_caps (stream->pad, stream->caps);
- GST_DEBUG ("adding pad %p to qtdemux %p", stream->pad, qtdemux);
+ GST_DEBUG ("adding pad %s %p to qtdemux %p",
+ gst_pad_get_name (stream->pad), stream->pad, qtdemux);
gst_element_add_pad (GST_ELEMENT (qtdemux), stream->pad);
}
@@ -2117,9 +2118,12 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
}
samples[j].chunk = j;
samples[j].offset = chunk_offset;
- samples[j].size =
- samples_per_chunk * stream->bytes_per_frame /
- stream->samples_per_packet / stream->compression;
+ if (stream->samples_per_packet * stream->compression != 0)
+ samples[j].size =
+ samples_per_chunk * stream->bytes_per_frame /
+ stream->samples_per_packet / stream->compression;
+ else
+ samples[j].size = 0;
samples[j].duration =
samples_per_chunk * GST_SECOND / (stream->rate / 2);
samples[j].timestamp = timestamp;