fix error when seg is empty (ENDK has a bug which does this)