make sure romgen handles out-of-bounds gracefully