summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2006-09-26 22:03:44 +0000
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2006-09-26 22:03:44 +0000
commit87cb9f4e90941a1db5d9941cf48ae80d0c89a71e (patch)
tree7f774fa9c7499525176a19bf3b766e218d885d31 /src
parentdf67b4d2d50b053fbae23a363d2f3aac964006d0 (diff)
downloadxine-lib-87cb9f4e90941a1db5d9941cf48ae80d0c89a71e.tar.gz
xine-lib-87cb9f4e90941a1db5d9941cf48ae80d0c89a71e.tar.bz2
Make sure that no possibly NULL pointer is dereferenced.
Found by Coverity Scan CID 248. CVS patchset: 8307 CVS date: 2006/09/26 22:03:44
Diffstat (limited to 'src')
-rw-r--r--src/xine-engine/events.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/xine-engine/events.c b/src/xine-engine/events.c
index 38c313554..2b16116b3 100644
--- a/src/xine-engine/events.c
+++ b/src/xine-engine/events.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: events.c,v 1.30 2006/01/27 19:49:23 tmattern Exp $
+ * $Id: events.c,v 1.31 2006/09/26 22:03:44 dgp85 Exp $
*
* Event handling functions
*
@@ -142,14 +142,17 @@ void xine_event_dispose_queue (xine_event_queue_t *queue) {
pthread_mutex_lock (&stream->event_queues_lock);
ite = xine_list_front (stream->event_queues);
- q = xine_list_get_value (stream->event_queues, ite);
- while (ite && (q != queue)) {
- ite = xine_list_next (stream->event_queues, ite);
- q = xine_list_get_value (stream->event_queues, ite);
+ if ( ite ) {
+ do {
+ q = xine_list_get_value (stream->event_queues, ite);
+
+ if ( q == queue )
+ break;
+ } while( (ite = xine_list_next (stream->event_queues, ite)) );
}
- if (!q) {
+ if (q != queue) {
xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "events: tried to dispose queue which is not in list\n");
pthread_mutex_unlock (&stream->event_queues_lock);