On 12/23/2014 11:19 AM, Julien Cristau wrote: > On Sun, Dec 21, 2014 at 12:08:44 -0800, Ian Romanick wrote: > >> From: Ian Romanick <ian.d.roman...@intel.com> >> >> Signed-off-by: Ian Romanick <ian.d.roman...@intel.com> >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87516 >> --- >> src/mesa/main/shaderapi.c | 26 ++++++++++++++++++++------ >> 1 file changed, 20 insertions(+), 6 deletions(-) >> >> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c >> index 108e3f5..c7e2633 100644 >> --- a/src/mesa/main/shaderapi.c >> +++ b/src/mesa/main/shaderapi.c >> @@ -1681,16 +1681,35 @@ _mesa_GetProgramBinary(GLuint program, GLsizei >> bufSize, GLsizei *length, >> GLenum *binaryFormat, GLvoid *binary) >> { >> struct gl_shader_program *shProg; >> + GLsizei length_dummy; >> GET_CURRENT_CONTEXT(ctx); >> >> shProg = _mesa_lookup_shader_program_err(ctx, program, >> "glGetProgramBinary"); >> if (!shProg) >> return; >> >> + /* The ARB_get_program_binary spec says: >> + * >> + * "If <length> is NULL, then no length is returned." >> + * >> + * Ensure that length always points to valid storage to avoid multiple >> NULL >> + * pointer checks below. >> + */ >> + if (length != NULL) >> + *length = &length_dummy; >> + > Is that supposed to read > > if (length == NULL) > length = &length_dummy;
Yes, of course. Good catch. > ? > > Cheers, > Julien > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev