mesa: avoid segfault in GetProgramPipelineInfoLog when no length

If there is no pipe info log, we would unconditionally deref length,
which was only optionally there. _mesa_copy_string handles the source
being null, as well as the length, so may as well just always call it.

Fixes a segfault in

dEQP-GLES31.functional.state_query.program_pipeline.info_log

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Ilia Mirkin 2016-02-12 14:23:30 -05:00
parent f82ff6207c
commit f56b5de877

View file

@ -964,8 +964,5 @@ _mesa_GetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize,
return;
}
if (pipe->InfoLog)
_mesa_copy_string(infoLog, bufSize, length, pipe->InfoLog);
else
*length = 0;
_mesa_copy_string(infoLog, bufSize, length, pipe->InfoLog);
}