]> git.mxchange.org Git - simgear.git/commitdiff
mat.cxx: fix an error reported by Valgrind
authorChristian Schmitt <chris@ilovelinux.de>
Wed, 19 Sep 2012 08:10:14 +0000 (10:10 +0200)
committerChristian Schmitt <chris@ilovelinux.de>
Wed, 19 Sep 2012 08:10:14 +0000 (10:10 +0200)
simgear/scene/material/mat.cxx

index 7a38c8fbcc447d6f982a10e7736072c80030384c..84b25659e8e42909f6a8b69857084fcdf5aa83a5 100644 (file)
@@ -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