mesa: clamp binary pointer in ShaderBinary if length==0
this pointer is only valid if length is valid fixes dEQP-GL45-ES3.functional.negative_api.shader.shader_binary with glthread enabled fixes #10915 cc: mesa-stable Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28501>
This commit is contained in:
committed by
Marge Bot
parent
6e91c88036
commit
37be4bf1b7
@@ -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:
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user