mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 23:30:04 +00:00
If the input stream fails during level 2 parsing, avoid an infinite loop
This commit is contained in:
parent
3705ca4f2e
commit
fdd09011f4
1 changed files with 3 additions and 3 deletions
|
|
@ -355,13 +355,13 @@ void Ar2vFileImpl::ParseLDMRecord(std::istream& is)
|
|||
{
|
||||
is.seekg(-2, std::ios_base::cur);
|
||||
}
|
||||
} while (!is.eof() && nextSize == 0u);
|
||||
} while (!is.eof() && !is.fail() && nextSize == 0u);
|
||||
|
||||
if (!is.eof() && offset != 0)
|
||||
if (!is.eof() && !is.fail() && offset != 0)
|
||||
{
|
||||
logger_->trace("Next record offset by {} bytes", offset);
|
||||
}
|
||||
else if (is.eof())
|
||||
else if (is.eof() || is.fail())
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue