mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 21:10:42 +00:00
Fix glShaderSource with negative lengths
Each element of length can still be negative to indicate the string is NULL-terminated.
This commit is contained in:
@@ -135,7 +135,7 @@ bool WrappedOpenGL::Serialise_glShaderSource(GLuint shader, GLsizei count, const
|
||||
{
|
||||
string s;
|
||||
if(source && source[i])
|
||||
s = length > 0 ? string(source[i], source[i] + length[i]) : string(source[i]);
|
||||
s = (length && length[i] > 0) ? string(source[i], source[i] + length[i]) : string(source[i]);
|
||||
|
||||
m_pSerialiser->SerialiseString("source", s);
|
||||
|
||||
@@ -1331,7 +1331,7 @@ bool WrappedOpenGL::Serialise_glCompileShaderIncludeARB(GLuint shader, GLsizei c
|
||||
{
|
||||
string s;
|
||||
if(path && path[i])
|
||||
s = length > 0 ? string(path[i], path[i] + length[i]) : string(path[i]);
|
||||
s = (length && length[i] > 0) ? string(path[i], path[i] + length[i]) : string(path[i]);
|
||||
|
||||
m_pSerialiser->SerialiseString("path", s);
|
||||
|
||||
@@ -1460,4 +1460,4 @@ void WrappedOpenGL::glDeleteNamedStringARB(GLint namelen, const GLchar *name)
|
||||
}
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
Reference in New Issue
Block a user