kwiver icon indicating copy to clipboard operation
kwiver copied to clipboard

Mesh_io should throw an exception on invalid input file

Open OwenMcGee opened this issue 3 years ago • 0 comments

Currently in read_mesh in vital/io/mesh_io.cxx, if the filename parameter does not end with a valid file extension (.ply2, .ply, or .obj), the function still returns the uninitialized mesh_sptr, when it should throw an exception indicating the bad input.

Outside of the function itself, the only reference to this code that would need to be updated as far as I can tell is in vital/tests/test_mesh_io.cxx.

All other read_ functions in the file are also lacking any exceptions, and don't verify that the input files are properly structured. In the case that a file is incorrectly formatted, they will also still return a mesh_sptr, which may be uninitialized or otherwise improperly formed. There should be verification that the input files are formatted correctly, and exceptions should be thrown if they are not.

OwenMcGee avatar Jun 29 '22 20:06 OwenMcGee