Skip to content

Main: tolerate bogus LOD chunk lengths in v1.8 meshes - #3780

Merged
paroj merged 1 commit into
OGRECave:masterfrom
paroj:devel
Oct 29, 2026
Merged

paroj merged 1 commit into
OGRECave:masterfrom
paroj:devel

Conversation

@paroj

@paroj paroj commented Oct 29, 2026

Copy link
Copy Markdown
Member

Some legacy exporters (e.g. Stunt Rally's) wrote an M_MESH_LOD_LEVEL chunk length that only covered the strategy string. Older Ogre versions parsed the nested chunks positionally and loaded these files, but the chunk size sanity check added since rejects them with "LOD level count exceeds chunk size".

The declared length is never used for seeking here, so bound the LOD count by the bytes left in the stream instead. This still rejects a count that cannot fit in the file, but accepts the under-declared lengths. Other mesh versions keep the chunk-based check.

Some legacy exporters (e.g. Stunt Rally's) wrote an M_MESH_LOD_LEVEL
chunk length that only covered the strategy string. Older Ogre versions
parsed the nested chunks positionally and loaded these files, but the
chunk size sanity check added since rejects them with "LOD level count
exceeds chunk size".

The declared length is never used for seeking here, so bound the LOD
count by the bytes left in the stream instead. This still rejects a
count that cannot fit in the file, but accepts the under-declared
lengths. Other mesh versions keep the chunk-based check.
@paroj
paroj merged commit 32ba96a into OGRECave:master Oct 29, 2026
6 checks passed
@paroj
paroj deleted the devel branch October 29, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant