http://www.jwz.org/xscreensaver/xscreensaver-5.12.tar.gz
[xscreensaver] / hacks / glx / tunnel_draw.c
index c87fea9dd57a875f4989df065180b2c6144d21aa..8230ca08a84c8fa154fd7e5a5152016fee940b87 100644 (file)
@@ -207,6 +207,7 @@ static void LoadPath(struct tunnel_state *st)
                }
                else
                {
+                        path1 = st->path;
                        path2 = (tnPath *)malloc(sizeof(tnPath));
                        path1->next = path2;
                        path1 = path2;
@@ -249,7 +250,9 @@ void DrawTunnel(struct tunnel_state *st,
        
        cmpos = st->cam_pos;
        /* Get current curve */
-       if (st->cam_pos->next->next->next)
+       if (st->cam_pos->next &&
+            st->cam_pos->next->next &&
+            st->cam_pos->next->next->next)
        {
                p1 = st->cam_pos;
                for (i=0; i<4; i++)