Guard null pointer access

When switching between seismic cubes with different sizes, a trace can end up being null
This commit is contained in:
Magne Sjaastad 2023-08-10 12:50:11 +02:00
parent 3dcb81ebfb
commit b7e2d2182c

View File

@ -585,7 +585,7 @@ std::shared_ptr<ZGYAccess::SeismicSliceData>
auto trace = m_filereader->trace( iline, xline, zMinIndex, zSize );
if ( trace->size() != zSize )
if ( trace == nullptr || trace->size() != zSize )
{
memset( pOut, 0, zSize * sizeof( float ) );
}
@ -614,7 +614,7 @@ std::shared_ptr<ZGYAccess::SeismicSliceData>
auto trace = m_filereader->trace( iline, xline, zMinIndex, zSize );
if ( trace->size() != zSize )
if ( trace == nullptr || trace->size() != zSize )
{
memset( pOut, 0, zSize * sizeof( float ) );
}