r600: make sure the number of indices is valid