jklimke / libcitygml

C++ Library for CityGML Parsing and Visualization
GNU Lesser General Public License v2.1
98 stars 55 forks source link

Importer crashes due to dereferencing deleted memory #76

Closed mlavik1 closed 1 year ago

mlavik1 commented 1 year ago

First of all, thanks a lot for making this great library!

When importing some larger datasets I ran into some crashes.

This appears to be the cause:

We can fix this by making sure the vectors containing the elements we send to GLU do not grow while GLU is processing them. That would be really simple if we knew before starting how many vertices we will need to add. Unfortunately I don't think we know that?

So here's my suggested solution:

It's confusing to explain, so I'll send you a PR :grin:

mlavik1 commented 1 year ago

Update: Made a PR: #77

And by the way, this is the dataset I tested with: https://carto.ville.namur.be/data/Bati3d_CityGML/maille-2907.zip (from here: https://opendata.bordeaux-metropole.fr/explore/dataset/bati3d/information/)