fix crash on parsing some SAMI files