mkazhdan / PoissonRecon

Poisson Surface Reconstruction
MIT License
1.56k stars 425 forks source link

FEMTree: Fix infinite loop due to 32-bit integer overflow. #269

Closed nh2 closed 1 year ago

nh2 commented 1 year ago

The code

size_t sz = nodeCount();
for( unsigned int i=0 ; i<sz ; i++ ) nodeHasData[i] = 0;

looped forever when nodeCount() is >= 2^32.

mkazhdan commented 1 year ago

Thanks. I have modified the code and updated the repo. Independently, did you enable the BIG_DATA macro in PreProcessor.h?

nh2 commented 1 year ago

Thanks. I have modified the code and updated the repo.

Great, thanks!

I've also posted

to help find such issues.

Independently, did you enable the BIG_DATA macro in PreProcessor.h?

Yes, but not in PreProcessor.hs, instead I'm currently passing it as a CFLAGS=-DBIG_DATA environment variable to make.

The project would really benefit from a proper build system such as Meson or CMake, vs. commenting in and out code and Makefile lines.