Skip to content

Commit b59c6b8

Browse files
author
Arthur Glowacki
committed
added check to make sure netcdf loading does not go over spec line size
1 parent 441be40 commit b59c6b8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/io/file/netcdf_io.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ size_t NetCDF_IO<T_real>::_load_spectra(E_load_type ltype,
240240
size_t inc_size = header_size + (spectra_size * MAX_NUM_SUPPORTED_DETECOTRS_PER_COL);
241241
for(size_t m1 = 0; m1 < cols_before_inc; m1++)
242242
{
243+
if (col_idx >= spec_line->size())
244+
{
245+
return col_idx;
246+
}
243247
size_t l = header_size + (m1 * inc_size);
244248
if (ltype == E_load_type::LINE)
245249
{

0 commit comments

Comments
 (0)