mirror of https://github.com/WerWolv/ImHex.git
sys: Catch error produced in file size querying
This commit is contained in:
parent
191a99f91b
commit
b28eaf2dbf
|
@ -103,9 +103,12 @@ namespace hex {
|
||||||
|
|
||||||
auto startPos = ftello64(this->m_file);
|
auto startPos = ftello64(this->m_file);
|
||||||
fseeko64(this->m_file, 0, SEEK_END);
|
fseeko64(this->m_file, 0, SEEK_END);
|
||||||
size_t size = ftello64(this->m_file);
|
auto size = ftello64(this->m_file);
|
||||||
fseeko64(this->m_file, startPos, SEEK_SET);
|
fseeko64(this->m_file, startPos, SEEK_SET);
|
||||||
|
|
||||||
|
if (size < 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue