SEGYimport crash for specific data

Issue can't reproduce before adding fb85b5d9

P1. It seems like the scan-forward and scan-backward functions are missing an iterator check:

// Scan forward
    {
...
        {
            while (segmentInfoIterator != sortedSegmentInfo.end()
                   && primaryAxis.CoordinateToSampleIndex(
                          static_cast<float>(segmentInfoIterator->m_primaryKey))
                          == primaryIndex)
            {
...
        }
    }

    // Scan backward
    {
...
        {
            while (segmentInfoIterator != sortedSegmentInfo.begin()
                   && primaryAxis.CoordinateToSampleIndex(
                          static_cast<float>(segmentInfoIterator->m_primaryKey))
                          == primaryIndex)
...
    }

Test sample:

G3D202109-01_lns10010_10900_cropped.segy

P2. Additionally, I found that heuristic analysis gives a warning about empty traces, but it is a fully valid cropped SEG-Y. Could it be that the check is a false positive?

Assignee Loading
Time tracking Loading