From bf2f15342bfee7e1bec19ff9abdb1999a4575f74 Mon Sep 17 00:00:00 2001 From: elsid Date: Tue, 4 May 2021 01:09:29 +0200 Subject: [PATCH] Compare positive int as std::size_t If records.size() is greater than max int comparison is invalid. --- components/nif/niffile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index 221f1d1f3..864a388e8 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -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(idx) < records.size()) { roots[i] = records[idx]; }