diff --git a/ChangeLog b/ChangeLog index 89d2708788..bb00aaecac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-11-14 Jan Schmidt + + * 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 * gst-libs/gst/interfaces/propertyprobe.c: diff --git a/gst/audioresample/gstaudioresample.c b/gst/audioresample/gstaudioresample.c index 52762202ee..1826849bcb 100644 --- a/gst/audioresample/gstaudioresample.c +++ b/gst/audioresample/gstaudioresample.c @@ -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; diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index fb065cb89f..a0e8bd06af 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -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);