diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index c5b0d8b5d72..81f2b11e685 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -2361,6 +2361,10 @@ _mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, GET_CURRENT_CONTEXT(ctx); struct gl_shader **sh; + /* no binary data can be loaded if length==0 */ + if (!length) + binary = NULL; + /* Page 68, section 7.2 'Shader Binaries" of the of the OpenGL ES 3.1, and * page 88 of the OpenGL 4.5 specs state: *