gst/audioresample/gstaudioresample.c: Guard against a NULL dereference I somehow encountered - with a FLUSH_STOP arri...

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.
This commit is contained in:
Jan Schmidt 2008-11-14 21:44:33 +00:00
parent 66ba67723e
commit ca161e799f
3 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,13 @@
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:

View 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;

View 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);