bug in glShaderContext_src.cxx

The function

glsl_compile_entry_point(GSG *gsg, Shader::ShaderType type)

contains the line

const char* text = _shader->get_text(type).c_str();

which is bad since get_text() returns a temporary string so text will point to deallocated memory.

The solution is to do:

const std::string str = _shader->get_text(type);
const char* text = str.c_str();

Thanks. This fix was already on the 1.7 branch, but didn’t make it onto the HEAD for some reason. I’ve just checked it in.