diff --git a/src/lib/OpenEXR/ImfIDManifest.cpp b/src/lib/OpenEXR/ImfIDManifest.cpp index 8ec2e76a77..d00980fe76 100644 --- a/src/lib/OpenEXR/ImfIDManifest.cpp +++ b/src/lib/OpenEXR/ImfIDManifest.cpp @@ -529,7 +529,7 @@ IDManifest::init (const char* data, const char* endOfData) for (size_t i = 0; i < m.getComponents ().size (); ++i) { int stringIndex = readVariableLengthInteger (data, endOfData); - if (size_t (stringIndex) > stringList.size () || + if (size_t (stringIndex) >= stringList.size () || stringIndex < 0) { throw IEX_NAMESPACE::InputExc (