mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-01 00:21:43 +00:00
- fixed crash in GLDEFS parser caused by missing texture
https://forum.zdoom.org/viewtopic.php?t=64234
This commit is contained in:
parent
6a3bc716e3
commit
ab53509774
1 changed files with 17 additions and 14 deletions
|
@ -1266,6 +1266,8 @@ class GLDefsParser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
|
if (tex)
|
||||||
|
{
|
||||||
bool okay = false;
|
bool okay = false;
|
||||||
for (int i = 0; i < MAX_CUSTOM_HW_SHADER_TEXTURES; i++)
|
for (int i = 0; i < MAX_CUSTOM_HW_SHADER_TEXTURES; i++)
|
||||||
{
|
{
|
||||||
|
@ -1274,7 +1276,7 @@ class GLDefsParser
|
||||||
tex->CustomShaderTextures[i] = TexMan.FindTexture(sc.String, ETextureType::Any, FTextureManager::TEXMAN_TryAny);
|
tex->CustomShaderTextures[i] = TexMan.FindTexture(sc.String, ETextureType::Any, FTextureManager::TEXMAN_TryAny);
|
||||||
if (!tex->CustomShaderTextures[i])
|
if (!tex->CustomShaderTextures[i])
|
||||||
{
|
{
|
||||||
sc.ScriptError("Custom hardware shader texture '%s' not found in texture '%s'\n", sc.String, tex ? tex->Name.GetChars() : "(null)");
|
sc.ScriptError("Custom hardware shader texture '%s' not found in texture '%s'\n", sc.String, tex->Name.GetChars());
|
||||||
}
|
}
|
||||||
|
|
||||||
texNameList.Push(textureName);
|
texNameList.Push(textureName);
|
||||||
|
@ -1285,7 +1287,8 @@ class GLDefsParser
|
||||||
}
|
}
|
||||||
if (!okay)
|
if (!okay)
|
||||||
{
|
{
|
||||||
sc.ScriptError("Error: out of texture units in texture '%s'", tex ? tex->Name.GetChars() : "(null)");
|
sc.ScriptError("Error: out of texture units in texture '%s'", tex->Name.GetChars());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sc.Compare("define"))
|
else if (sc.Compare("define"))
|
||||||
|
|
Loading…
Reference in a new issue