From 4ac8b6943282c5384d2bbf71d757c0f316486896 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 23 Jun 2009 15:42:06 -0700 Subject: [PATCH] Added NULL check to avoid seg fault... --- src/tuio.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/tuio.c b/src/tuio.c index cc28212..4a9a98b 100644 --- a/src/tuio.c +++ b/src/tuio.c @@ -208,7 +208,7 @@ TuioReadInput(InputInfoPtr pInfo) while(xf86WaitForInput(pInfo->fd, 0) > 0) { - /* liblo will receive a message and call the applicable + /* liblo will receive a message and call the appropriate * handlers (i.e. _tuio_lo_cur2d_hande()) * If nothing is found (this SHOULDN'T happen, but if it did, * all the objects would be deleted), just return */ @@ -219,13 +219,15 @@ TuioReadInput(InputInfoPtr pInfo) * any "active" messages will be handled by flagging * the listed object ids. Now that processing is done, * remove any dead object ids. */ - if (!obj->alive) { - objtemp = obj->next; - _object_remove(list, obj); - obj = objtemp; - } else { - obj->alive = 0; /* Reset for next message */ - obj = obj->next; + if (obj != NULL) { + if (!obj->alive) { + objtemp = obj->next; + _object_remove(list, obj); + obj = objtemp; + } else { + obj->alive = 0; /* Reset for next message */ + obj = obj->next; + } } } } -- 2.11.4.GIT