mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:23:53 +00:00
Avoid underflows if the texture name doesn't include a '.'
This commit is contained in:
parent
3f19b13695
commit
1d4d67f811
1 changed files with 2 additions and 5 deletions
|
@ -537,14 +537,11 @@ static Ogre::String getMaterial(const NiTriShape *shape, const Ogre::String &nam
|
|||
* textures from tga to dds for increased load speed, but all
|
||||
* texture file name references were kept as .tga.
|
||||
*/
|
||||
|
||||
static const char * path = "textures\\";
|
||||
static const char path[] = "textures\\";
|
||||
|
||||
texName = path + st->filename;
|
||||
|
||||
Ogre::String::size_type pos = texName.rfind('.');
|
||||
|
||||
if (texName.compare (pos, texName.size () - pos, ".dds") != 0)
|
||||
if(pos != Ogre::String::npos && texName.compare(pos, texName.length() - pos, ".dds") != 0)
|
||||
{
|
||||
// since we know all (GOTY edition or less) textures end
|
||||
// in .dds, we change the extension
|
||||
|
|
Loading…
Reference in a new issue