gst/typefind/gsttypefindfunctions.c: Don't segfault on NULL data.

Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (aac_type_find):
Don't segfault on NULL data.
This commit is contained in:
Wim Taymans 2004-11-08 09:48:31 +00:00
parent ac515f710f
commit 4778549c39
2 changed files with 15 additions and 8 deletions

View file

@ -1,3 +1,8 @@
2004-11-08 Wim Taymans <wim@fluendo.com>
* gst/typefind/gsttypefindfunctions.c: (aac_type_find):
Don't segfault on NULL data.
2004-11-08 Wim Taymans <wim@fluendo.com>
* gst/playback/gstdecodebin.c: (unlinked):

View file

@ -222,6 +222,7 @@ aac_type_find (GstTypeFind * tf, gpointer unused)
* note that this is a pretty lame typefind method (14 bits, 0.006%), so
* we'll only use LIKELY
*/
if (data) {
if (data[0] == 0xFF && (data[1] & 0xF6) == 0xF0) {
gboolean mpegversion = (data[1] & 0x08) ? 2 : 4;
GstCaps *caps = gst_caps_new_simple ("audio/mpeg",
@ -232,6 +233,7 @@ aac_type_find (GstTypeFind * tf, gpointer unused)
gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, caps);
gst_caps_free (caps);
}
}
}
/*** audio/mpeg version 1 ****************************************************/