mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-02-05 03:35:32 +00:00
Fix index-out-of-bounds crash when getting shader param substring.
This commit is contained in:
@ -255,7 +255,8 @@ GLuint ShaderEngine::compilePresetShader(const PresentShaderType shaderType, Sha
|
||||
|
||||
if (texDesc.first == NULL)
|
||||
{
|
||||
if (lowerCaseName.substr(0, 4) == "rand" || lowerCaseName.substr(2, 5) == "_rand")
|
||||
if ((lowerCaseName.size() >= 4 && lowerCaseName.substr(0, 4) == "rand") ||
|
||||
(lowerCaseName.size() >= 5 && lowerCaseName.substr(2, 5) == "_rand"))
|
||||
{
|
||||
texDesc = textureManager->getRandomTextureName(sampler);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user