--- a/src/player.c
+++ b/src/player.c
@@ -61,7 +61,7 @@
 static pthread_t       play_thread;
 static char           *cur_mrl = NULL, *cur_title = NULL;
 
-static void *play_exec (void *queue_gen)
+static __attribute__ ((noreturn)) void *play_exec (void *queue_gen)
 {
   xine_cfg_entry_t entry;
   char *hash, *mrl = NULL;
@@ -84,10 +84,10 @@
     char *name = cur_mrl + 5;
     if (name)
     {
-      int length = (strchr (name, '#') ? : name + strlen (name)) - name;
+      unsigned int length = (strchr (name, '#') ? : name + strlen (name)) - name;
       char file[length + 5]; /* allow for ".ext" + NUL */
 
-      int i = -1, ext = 0;
+      unsigned int i = UINT_MAX, ext = 0;
 
       /* URL decode (can't simply use g_filename_from_uri()...) */
       while (++i < length)
@@ -105,8 +105,9 @@
 
       /* find last '.' in leaf */
       i = ext;
-      while (--ext && file[ext] != '.' && file[ext] != '/')
-	/**/;
+      if (ext)
+	while (--ext && file[ext] != '.' && file[ext] != '/')
+	  /**/;
       if (file[ext] == '/') /* if no '.' */
 	ext = i;
 
@@ -187,7 +188,6 @@
   pthread_mutex_unlock (&widgets_update_lock);
   /*pthread_mutex_unlock (&engine_lock);*/
   pthread_exit (NULL);
-  return NULL;
 }
 
 void player_launch (const char *title, const char *mrl, int pos, int pos_time)