wtay gst-plugins-good: gst-plugins-good/ gst-plugins-good/gst/qtdemux/

[email protected] Thu, 15 Jan 2009 06:53:32 -0800 (PST)
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
--===============0872825715990078300==

CVS Root:       /cvs/gstreamer
Module:         gst-plugins-good
Changes by:     wtay
Date:           Thu Jan 15 2009  14:53:32 UTC

Log message:
* gst/qtdemux/qtdemux.c: (qtdemux_parse_segments):
Catch invalid and commonly wrong playback rates in the elst atoms.
Fixes #567800.

Modified files:
    .               : ChangeLog
    gst/qtdemux     : qtdemux.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.3900&r2=1.3901
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/qtdemux/qtdemux.c.diff?r1=1.243&r2=1.244

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v
retrieving revision 1.3900
retrieving revision 1.3901
diff -u -d -r1.3900 -r1.3901
--- ChangeLog	15 Jan 2009 11:40:22 -0000	1.3900
+++ ChangeLog	15 Jan 2009 14:53:16 -0000	1.3901
@@ -1,3 +1,9 @@
+2009-01-15  Wim Taymans  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* gst/spectrum/gstspectrum.c: (gst_spectrum_reset_state):
Index: qtdemux.c
RCS file: /cvs/gstreamer/gst-plugins-good/gst/qtdemux/qtdemux.c,v
retrieving revision 1.243
retrieving revision 1.244
diff -u -d -r1.243 -r1.244
--- qtdemux.c	13 Jan 2009 19:09:19 -0000	1.243
+++ qtdemux.c	15 Jan 2009 14:53:18 -0000	1.244
@@ -3247,6 +3247,7 @@
       guint64 duration;
       guint64 media_time;
       QtDemuxSegment *segment;
+      guint32 rate_int;
       media_time = QT_UINT32 (buffer + 20 + i * 12);
@@ -3269,13 +3270,23 @@
       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;


--===============0872825715990078300==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
--===============0872825715990078300==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
gstreamer-cvs-verbose mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs-verbose

--===============0872825715990078300==--