PointCloudLibrary/pcl

Kinfu MarchingCubes writes unbounded data to hardcode sized buffer

Open

#719 geöffnet am 31. Mai 2014

Auf GitHub ansehen
 (12 Kommentare) (0 Reaktionen) (1 zugewiesene Person)C++ (4.506 Forks)batch import
help wantedkind: bugmodule: gpuskill: cudastatus: stale

Repository-Metriken

Stars
 (9.023 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T 7h) (3 gemergte PRs in 30 T)

Beschreibung

pcl::gpu::MarchingCubes::run:

  if (triangles_buffer.empty())
    triangles_buffer.create(DEFAULT_TRIANGLES_BUFFER_SIZE);
DEFAULT_TRIANGLES_BUFFER_SIZE = 2 * 1000 * 1000 * POINTS_PER_TRIANGLE

marching_cubes.cu/store_point():

triangles_buffer[index] = ...; // index is dependent on how many voxels we have

I suggest changing DEFAULT_TRIANGLES_BUFFER_SIZE to WHY_WOULD_ANYONE_EVER_HAVE_MORE_TRIANGLES, that will make the out of bounds crash on the GPU much easier to find.

I also like how it starts with 2 * - that looks almost like somebody thought "hmm for some reason the code works if I make this bigger".

Contributor Guide