From fa883c1ca162da96b658c8a4abcf70de78980558 Mon Sep 17 00:00:00 2001 From: "Joshua M. Doe" Date: Thu, 28 Jun 2012 13:17:25 -0400 Subject: [PATCH] niimaq: make sure timelist exists before modifying it Caused seg fault unless delay was introduced (e.g. with debugging messages on). Still need to investigate why we don't get a timestamp before the first frame. --- sys/niimaq/gstniimaq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/niimaq/gstniimaq.c b/sys/niimaq/gstniimaq.c index 199c279..61e85f0 100644 --- a/sys/niimaq/gstniimaq.c +++ b/sys/niimaq/gstniimaq.c @@ -761,7 +761,8 @@ gst_niimaqsrc_create (GstPushSrc * psrc, GstBuffer ** buffer) /* search linked list for frame time */ g_mutex_lock (niimaqsrc->frametime_mutex); - { + if (G_LIKELY (niimaqsrc->timelist) + && g_slist_length (niimaqsrc->timelist) > 0) { /* remove all old frametimes from the list */ frametime = niimaqsrc->timelist->data; while (frametime->number < copied_number) {