Skip to content
Snippets Groups Projects
Commit 2930e76b authored by Kenneth Moreland's avatar Kenneth Moreland
Browse files

Fix netCDF crash when reading empty attributes

When reading an attribute, vtkNetCDFCFReader would allocate an
std::string of the appropriate length, then grab the C pointer from it
and call the netCDF library to fill it with the value for the attribute.
The problem was that if the attribute was zero-length, std::string would
throw an exception if you tried to grab the pointer. Fix the problem by
not loading any data if the length is 0.

Also added some defensive code for when reading cell bounds when there
are no cells.
parent e4fd6ab4
Loading
Pipeline #
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment