Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
OpenGL
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
C-Fu
OpenGL
Commits
ff08ee7c
Commit
ff08ee7c
authored
Feb 02, 2017
by
Anakin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
error handling when out of file
parent
8346e591
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
QtMeshViewer/Source/MshFile.cpp
QtMeshViewer/Source/MshFile.cpp
+2
-8
No files found.
QtMeshViewer/Source/MshFile.cpp
View file @
ff08ee7c
...
...
@@ -87,16 +87,10 @@ void MshFile::loadChunks(QList<ChunkHeader*>& destination, qint64 start, const q
destination
.
push_back
(
tmp_header
);
// jump to next header
if
(
!
m_file
.
seek
(
tmp_header
->
size
+
m_file
.
pos
()))
{
OutputDevice
::
getInstance
()
->
print
(
"WARNING: corrupted file. Trying to continue.."
,
1
);
m_file
.
unsetError
();
m_file
.
seek
(
0
);
break
;
}
m_file
.
seek
(
tmp_header
->
size
+
m_file
.
pos
());
// out of file. Maybe a size information is corrupted
if
(
m_file
.
error
()
!=
QFileDevice
::
NoError
)
if
(
m_file
.
atEnd
()
||
m_file
.
error
()
!=
QFileDevice
::
NoError
)
{
OutputDevice
::
getInstance
()
->
print
(
"WARNING: corrupted file. Trying to continue.."
,
1
);
m_file
.
unsetError
();
...
...
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