Commit c23ed24a by Michael Krämer

return error when reaching EOF, skip reading extra elements after 'FACE'

1 parent 1ae04a22
Pipeline #4223 for c23ed24a passed in 45 minutes 35 seconds
......@@ -479,6 +479,18 @@ bool _PLYReader_::read_ascii(std::istream& _in, BaseImporter& _bi, const Options
}
}
}
if (_in.eof()) {
if (err_enabled)
omerr().enable();
omerr() << "Unexpected end of file while reading." << std::endl;
return false;
}
if(e_it->element_== FACE)
// stop reading after the faces since additional elements are not preserved anyway
break;
}
if (err_enabled)
......@@ -694,6 +706,17 @@ bool _PLYReader_::read_binary(std::istream& _in, BaseImporter& _bi, bool /*_swap
}
}
if (_in.eof()) {
if (err_enabled)
omerr().enable();
omerr() << "Unexpected end of file while reading." << std::endl;
return false;
}
if (e_it->element_ == FACE)
// stop reading after the faces since additional elements are not preserved anyway
break;
}
if (err_enabled)
omerr().enable();
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!