Added checks to avoid possible crashes opening tampered-with wad archives