Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenMesh
OpenMesh
Commits
c23ed24a
Commit
c23ed24a
authored
Feb 03, 2017
by
Michael Krämer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return error when reaching EOF, skip reading extra elements after 'FACE'
parent
1ae04a22
Pipeline
#4223
passed with stage
in 45 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
src/OpenMesh/Core/IO/reader/PLYReader.cc
src/OpenMesh/Core/IO/reader/PLYReader.cc
+23
-0
No files found.
src/OpenMesh/Core/IO/reader/PLYReader.cc
View file @
c23ed24a
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment