Fixed runtime failure in cg_draw.c