From 81ef922f02d84b0fc9552073c4029ed14ba3216e Mon Sep 17 00:00:00 2001 From: Christian Schmitt Date: Wed, 19 Sep 2012 10:10:14 +0200 Subject: [PATCH] mat.cxx: fix an error reported by Valgrind --- simgear/scene/material/mat.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simgear/scene/material/mat.cxx b/simgear/scene/material/mat.cxx index 7a38c8fb..84b25659 100644 --- a/simgear/scene/material/mat.cxx +++ b/simgear/scene/material/mat.cxx @@ -239,7 +239,7 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options, bool dds_mask = (ompath.lower_extension() == "dds"); - if (dds[i] != dds_mask) { + if (i < dds.size() && dds[i] != dds_mask) { // Texture format does not match mask format. This is relevant for // the object mask, as DDS textures have an origin at the bottom // left rather than top left. Therefore we flip a copy of the image -- 2.39.5