gst/typefind/gsttypefindfunctions.c: Don't crash on truncated files - check that we got an 8 byte buffer before tryin...

Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (ogganx_type_find):
Don't crash on truncated files - check that we got an 8 byte buffer
before trying to memcmp it.
This commit is contained in:
Michael Smith 2006-09-17 21:58:06 +00:00
parent aeb0afba16
commit 1720784dc1
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2006-09-17 Michael Smith <msmith@fluendo.com>
* gst/typefind/gsttypefindfunctions.c: (ogganx_type_find):
Don't crash on truncated files - check that we got an 8 byte buffer
before trying to memcmp it.
2006-09-17 Tim-Philipp Müller <tim at centricular dot net>
* gst/playback/gstplaybasebin.c: (get_active_source):

View file

@ -1953,7 +1953,7 @@ ogganx_type_find (GstTypeFind * tf, gpointer private)
/* Check for an annodex fishbone header */
data = gst_type_find_peek (tf, 28, 8);
if (memcmp (data, "fishead\0", 8) == 0)
if (data && memcmp (data, "fishead\0", 8) == 0)
gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, OGGANX_CAPS);
gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM,