From c621d0400c58e4e7cff5ec8bfc7fe5f5073d80aa Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 9 Jun 2015 18:22:18 +0200 Subject: [PATCH] Fix error handling for out-of-range NIF roots (found in Bosmora, TR) --- components/nif/niffile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index 0a6f8f505..1db9c8ccf 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -193,9 +193,9 @@ void NIFFile::parse() for(size_t i = 0;i < rootNum;i++) { int idx = nif.getInt(); - if (idx >= 0) + if (idx >= 0 && idx < int(records.size())) { - roots[i] = records.at(idx); + roots[i] = records[idx]; } else {