From 034094d7a40551ed1256659cb205ef6d43a56dc0 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sat, 18 Jan 2003 18:10:53 +0000 Subject: [PATCH] don't segfault when data didn't make it in Original commit message from CVS: don't segfault when data didn't make it in --- common | 2 +- gst/qtdemux/qtdemux.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common b/common index 5b6a58f..895baa0 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 5b6a58f419c3d6fdd4abbe9943cd17a4fd2addcc +Subproject commit 895baa0fa0f829ef752424a31bbb2cf68e63842e diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index f676989..06aae97 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -211,11 +211,14 @@ gst_qtdemux_init (GstQTDemux *qtdemux) } static GstCaps* -quicktime_type_find (GstBuffer *buf, - gpointer private) +quicktime_type_find (GstBuffer *buf, gpointer private) { gchar *data = GST_BUFFER_DATA (buf); + /* we could get a NULL buffer, for example when the input could not be + * mmap'd */ + g_return_val_if_fail (data != NULL, NULL); + /* exactly like in the old version */ if (!strncmp (&data[4], "wide", 4) || !strncmp (&data[4], "moov", 4) || -- 2.7.4