try to move out CONTACT* c, and COLOR clr (I think if it's a local variable it should not be a pointer just like in case of vectors - the temporary vector quantity is limited to 32 if I remember well, so probably it is the error reason) before the loop and use only c = ent_getvertex... and clr = ...