opengametools icon indicating copy to clipboard operation
opengametools copied to clipboard

CHUNK_ID_XYZI voxel bounds check to improve handling of corrupt files

Open dougbinks opened this issue 2 years ago • 4 comments

I've encountered a number of vox files which were corrupt with voxels outside the bounds of the model size. This results in the voxel array bounds being overwritten when loaded.

There's already an assert in the code, but this PR adds the same test to adding the voxel data to the array. I've been able to recover some data from models which otherwise would not load with this addition and I don't think the performance hit is significant.

dougbinks avatar Aug 01 '23 14:08 dougbinks

This is also part of https://github.com/jpaver/opengametools/pull/58 - with ogt_warn

mgerhardy avatar Aug 01 '23 16:08 mgerhardy

Ah, I didn't spot that. This can be closed if you're intending to accept that change.

dougbinks avatar Aug 01 '23 16:08 dougbinks

Well, I would be thankful on your input on where I've added the ogt_warn stuff and where it still is ogt_assert. Not sure if my PR would get accepted that way. Let's see

mgerhardy avatar Aug 01 '23 17:08 mgerhardy

I'll take a look soon.

dougbinks avatar Aug 01 '23 17:08 dougbinks