Skip to content

[BUG] Vector subscript out of range #107

Description

@OgreTransporter

void* data = reinterpret_cast<void*>(static_cast<uintptr_t>(_indices[contour.index + i]));

It can happen that _indices has no entries. The programme then crashes at this point.

The problem is probably an incorrect data record:

          <bldg:boundedBy>
            <bldg:WallSurface gml:id="ID_32655201-c6d4-4ea7-9bb1-8ddc42b99db6">
              <bldg:lod2MultiSurface>
                <gml:MultiSurface gml:id="ID_165a3a3f-1833-46a3-9532-7e98abac7bb8">
                  <gml:surfaceMember>
                    <gml:Polygon gml:id="GUID_10261589853449375537_2_2_3">
                      <gml:exterior>
                        <gml:LinearRing gml:id="GUID_10261589853449375537_2_2_3_0_">
                          <gml:posList srsDimension="3">395265.810 5698394.509 237.418 395265.810 5698394.509 232.362 395265.810 5698394.509 232.362 395265.810 5698394.509 237.418</gml:posList>
                        </gml:LinearRing>
                      </gml:exterior>
                    </gml:Polygon>
                  </gml:surfaceMember>
                </gml:MultiSurface>
              </bldg:lod2MultiSurface>
            </bldg:WallSurface>

To solve the problem, I suggest the following change in the compute function:

if (!_vertices.empty() && !_indices.empty()) processContours();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions