gst/audioresample/gstaudioresample.c: Guard against a NULL dereference I somehow...
authorJan Schmidt <thaytan@mad.scientist.com>
Fri, 14 Nov 2008 21:44:33 +0000 (21:44 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Fri, 14 Nov 2008 21:44:33 +0000 (21:44 +0000)
Original commit message from CVS:
* gst/audioresample/gstaudioresample.c:
Guard against a NULL dereference I somehow encountered -
with a FLUSH_STOP arriving either before basetransform _start(),
or after _stop().
* gst/typefind/gsttypefindfunctions.c:
Make sure we never jump backwards when typefinding corrupt mov files.

ChangeLog
gst/audioresample/gstaudioresample.c
gst/typefind/gsttypefindfunctions.c

index 89d2708..bb00aae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2008-11-14  Jan Schmidt  <jan.schmidt@sun.com>
 
+       * gst/audioresample/gstaudioresample.c:
+       Guard against a NULL dereference I somehow encountered -
+       with a FLUSH_STOP arriving either before basetransform _start(),
+       or after _stop().
+
+       * gst/typefind/gsttypefindfunctions.c:
+       Make sure we never jump backwards when typefinding corrupt mov files.
+
+2008-11-14  Jan Schmidt  <jan.schmidt@sun.com>
+
        * gst-libs/gst/interfaces/propertyprobe.c:
        Fix random type causing a docs warning.
 
index 5276220..1826849 100644 (file)
@@ -484,7 +484,8 @@ audioresample_event (GstBaseTransform * base, GstEvent * event)
     case GST_EVENT_FLUSH_START:
       break;
     case GST_EVENT_FLUSH_STOP:
-      resample_input_flush (audioresample->resample);
+      if (audioresample->resample)
+        resample_input_flush (audioresample->resample);
       audioresample->ts_offset = -1;
       audioresample->next_ts = -1;
       audioresample->offset = -1;
index fb065cb..a0e8bd0 100644 (file)
@@ -1994,6 +1994,8 @@ qt_type_find (GstTypeFind * tf, gpointer unused)
   guint64 size;
 
   while ((data = gst_type_find_peek (tf, offset, 8)) != NULL) {
+    guint64 new_offset;
+
     /* box/atom types that are in common with ISO base media file format */
     if (STRNCMP (&data[4], "moov", 4) == 0 ||
         STRNCMP (&data[4], "mdat", 4) == 0 ||
@@ -2031,7 +2033,10 @@ qt_type_find (GstTypeFind * tf, gpointer unused)
       if (size < 8)
         break;
     }
-    offset += size;
+    new_offset = offset + size;
+    if (new_offset <= offset)
+      break;
+    offset = new_offset;
   }
   if (tip > 0) {
     gst_type_find_suggest (tf, tip, QT_CAPS);