Don't seek file until after it's checked for validity

This commit is contained in:
baldurk
2021-04-13 16:28:08 +01:00
parent 49e05bee72
commit 208ab0fd7d
+2 -1
View File
@@ -781,13 +781,14 @@ void RDCFile::Create(const rdcstr &filename)
// re-open as read-only now.
FileIO::fclose(m_File);
m_File = FileIO::fopen(filename, FileIO::ReadBinary);
FileIO::fseek64(m_File, 0, SEEK_END);
if(!m_File)
{
RETURNERROR(ContainerError::FileIO, "Can't open capture file '%s' as read-only, errno %d",
filename.c_str(), errno);
}
FileIO::fseek64(m_File, 0, SEEK_END);
}
int RDCFile::SectionIndex(SectionType type) const