#658: avoid crash when Textures.high is missing

Don't resolve the empty file name, which would result in the fgdata
directory path (instead of a path to a file). Eventually this resulted in
a segfault, partly due to a bug in "osgDB::readImageFile", which reports
"success" when given a directory (instead of a file) path, though it
doesn't return a valid image object.
This commit is contained in:
ThorstenB
2012-02-11 09:54:53 +01:00
parent c41d504a29
commit cfda390557

View File

@@ -216,11 +216,14 @@ TexTuple makeTexTuple(Effect* effect, const SGPropertyNode* props,
if (pImage)
{
imageName = pImage->getStringValue();
absFileName = SGModelLib::findDataFile(imageName, options);
if (absFileName.empty())
if (!imageName.empty())
{
SG_LOG(SG_INPUT, SG_ALERT, "Texture file not found: '"
<< imageName << "'");
absFileName = SGModelLib::findDataFile(imageName, options);
if (absFileName.empty())
{
SG_LOG(SG_INPUT, SG_ALERT, "Texture file not found: '"
<< imageName << "'");
}
}
}