1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 03:35:27 +00:00

Compare positive int as std::size_t

If records.size() is greater than max int comparison is invalid.
This commit is contained in:
elsid 2021-05-04 01:09:29 +02:00
parent 1c08bc0b15
commit bf2f15342b
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

View File

@ -315,7 +315,7 @@ void NIFFile::parse(Files::IStreamPtr stream)
for (std::size_t i = 0; i < rootNum; i++)
{
int idx = nif.getInt();
if (idx >= 0 && idx < int(records.size()))
if (idx >= 0 && static_cast<std::size_t>(idx) < records.size())
{
roots[i] = records[idx];
}