Loading a Terrain crashes when file has more than just Terrain data.

Description

Here's what happens:

  • You can write Terrain data into a DataStream, where you have first written other, unrelated blocks of data. This works fine.

  • When trying to load such a file, TerrainLodManager::readLodData opens a new stream into the file, and assuming the file only has Terrain data in it, tries to skip over some blocks and thehn read its own LoD blocks. This doesn't work.

  • The actual crash happens at TerrainLodManager::updateToLodLevel for some reason, where the this pointer seems to have got corrupted and leads to an access violation.
    I'm pretty sure this is what happens. Just try it for yourself, write a few blocks of your own data into a file before the terrain data, and try to load it accordingly.

Environment

Irrelevant

Status

Assignee

Murat Sari

Reporter

Noorus

Labels

None

Components

Fix versions

Affects versions

Priority

Critical
Configure