diff options
author | David Schleef <ds@schleef.org> | 2003-07-24 08:49:42 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2003-07-24 08:49:42 +0000 |
commit | 322baf19c80857f1f2b016ec6bf043d09c67d154 (patch) | |
tree | 188aeeb96adf54022f3884d9e3a731765e7bd70e /ext/flac/gstflac.c | |
parent | 7bea2b377a4bb138b26ef7b07a466380ae7e13b0 (diff) |
Add buffer length checks to every typefinding function
Original commit message from CVS:
Add buffer length checks to every typefinding function
Diffstat (limited to 'ext/flac/gstflac.c')
-rw-r--r-- | ext/flac/gstflac.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/flac/gstflac.c b/ext/flac/gstflac.c index af10d794..b8dd73e8 100644 --- a/ext/flac/gstflac.c +++ b/ext/flac/gstflac.c @@ -71,8 +71,12 @@ static GstTypeDefinition flacdefinition = { static GstCaps* flac_type_find (GstBuffer *buf, gpointer private) { - guint32 head = GUINT32_FROM_BE (*((guint32 *)GST_BUFFER_DATA (buf))); + guint32 head; + + if (GST_BUFFER_SIZE (buf) < 4) + return NULL; + head = GUINT32_FROM_BE (*((guint32 *)GST_BUFFER_DATA (buf))); if (head != 0x664C6143) return NULL; |