From 1720784dc1fedb10aabfb74ecd03818fe3d10cf9 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sun, 17 Sep 2006 21:58:06 +0000 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ gst/typefind/gsttypefindfunctions.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 984493af98..a73a1d2c40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-09-17 Michael Smith + + * 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 * gst/playback/gstplaybasebin.c: (get_active_source): diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index bc7c2bc82d..d44102efa9 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -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,