diff options
Diffstat (limited to 'ext/dv/gstdvdec.c')
-rw-r--r-- | ext/dv/gstdvdec.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/dv/gstdvdec.c b/ext/dv/gstdvdec.c index d7500cc6..e28f8362 100644 --- a/ext/dv/gstdvdec.c +++ b/ext/dv/gstdvdec.c @@ -161,9 +161,14 @@ GST_PAD_TEMPLATE_FACTORY ( audio_src_temp, static GstCaps* dv_type_find (GstBuffer *buf, gpointer private) { - guint32 head = GUINT32_FROM_BE(*((guint32 *)GST_BUFFER_DATA(buf))); + guint32 head; GstCaps *new = NULL; + if (GST_BUFFER_SIZE (buf) < 5) + return NULL; + + head = GUINT32_FROM_BE(*((guint32 *)GST_BUFFER_DATA(buf))); + /* check for DIF and DV flag */ if ((head & 0xffffff00) == 0x1f070000 && !(GST_BUFFER_DATA(buf)[4] & 0x01)) { gchar *format; |