meshoptimizer icon indicating copy to clipboard operation
meshoptimizer copied to clipboard

gltfpack could generate invalid gltf when float numbers are invalid

Open hu-xd opened this issue 1 year ago • 1 comments
trafficstars

I have a valid glb file, become invalid after being processed with gltfpack, because 'inf' is invalid json number:

"KHR_texture_transform": { "offset": [-2.60883001e+38, -39.7892303], "scale": [inf, inf] }

gltfpack generates valid gltf if I add -noq option, which apparently doesn't use KHR_texture_transform here

hu-xd avatar Aug 28 '24 06:08 hu-xd

Please attach the file (before processing).

zeux avatar Aug 28 '24 13:08 zeux

well, I'll see if I can make a simple sample to repro it. but the point of my report is not about the actual file, I think the tool should be defensive and avoid output invalid json data in whatever case.

hu-xd avatar Aug 29 '24 16:08 hu-xd

Yes, I think it’s reasonable to sanitize inf/nan during output, but ideally they also should not be produced during processing; if that happens on a real scene and not an artificially constructed input, it would be nice to debug and adjust the logic responsible.

zeux avatar Aug 29 '24 17:08 zeux