Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential bug in indexer code #635

Open
rhuitl opened this issue Aug 5, 2023 · 0 comments
Open

Potential bug in indexer code #635

rhuitl opened this issue Aug 5, 2023 · 0 comments

Comments

@rhuitl
Copy link

rhuitl commented Aug 5, 2023

In https://github.com/potree/PotreeConverter/blob/develop/Converter/src/indexer.cpp#L1165, the members of min, which are of type int32, are assigned the maximum value for an int64. This results in an implicit conversion to -1, breaking the following logic that is supposed to determine the minimum values. I think it's going to be stuck at -1 for clouds that don't have any values less than that.

Clang warns about this:

warning: implicit conversion from 'std::numeric_limits<long long>::type' (aka 'long long') to 'int32_t' (aka 'int') changes value from 9223372036854775807 to -1

The problem is that when I fix this issue by changing the Int64_t to int32_t, it solves the compiler warning. However, when Brotli compression is used, it will lead to a corrupt output cloud - in the viewer it looks like the point coordinates are shifted outside their node boxes.

I can try to come up with a way to reproduce this, but maybe the description is sufficient to figure out what's going on.

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

No branches or pull requests

1 participant