summaryrefslogtreecommitdiffstats
path: root/ext/flac/gstflac.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/flac/gstflac.c')
-rw-r--r--ext/flac/gstflac.c6
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;