+2009-01-15 Wim Taymans <wim.taymans@collabora.co.uk>
+
+ * gst/qtdemux/qtdemux.c: (qtdemux_parse_segments):
+ Catch invalid and commonly wrong playback rates in the elst atoms.
+ Fixes #567800.
+
2009-01-15 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* gst/spectrum/gstspectrum.c: (gst_spectrum_reset_state):
guint64 duration;
guint64 media_time;
QtDemuxSegment *segment;
+ guint32 rate_int;
media_time = QT_UINT32 (buffer + 20 + i * 12);
segment->media_start =
gst_util_uint64_scale (media_time, GST_SECOND, stream->timescale);
segment->media_stop = segment->media_start + segment->duration;
- segment->rate = QT_FP32 (buffer + 24 + i * 12);
+ rate_int = GST_READ_UINT32_BE (buffer + 24 + i * 12);
+
+ if (rate_int <= 1) {
+ /* 0 is not allowed, some programs write 1 instead of the floating point
+ * value */
+ GST_WARNING_OBJECT (qtdemux, "found suspicious rate %" G_GUINT32_FORMAT,
+ rate_int);
+ segment->rate = 1;
+ } else {
+ segment->rate = rate_int / 65536.0;
+ }
GST_DEBUG_OBJECT (qtdemux, "created segment %d time %" GST_TIME_FORMAT
", duration %" GST_TIME_FORMAT ", media_time %" GST_TIME_FORMAT
- ", rate %g", i, GST_TIME_ARGS (segment->time),
+ ", rate %g, (%d)", i, GST_TIME_ARGS (segment->time),
GST_TIME_ARGS (segment->duration),
- GST_TIME_ARGS (segment->media_start), segment->rate);
+ GST_TIME_ARGS (segment->media_start), segment->rate, rate_int);
}
GST_DEBUG_OBJECT (qtdemux, "found %d non-empty segments", count);
stream->n_segments = count;