From 57a9c1ee478c5af8cc2f9ffe78b24917deebb1b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 24 Feb 2020 20:46:02 -0500 Subject: [PATCH] glthread: fix a crash with incorrect glShaderSource parameters Reviewed-by: Timothy Arceri Part-of: --- src/mesa/main/marshal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/marshal.c b/src/mesa/main/marshal.c index 9c9d6720878..b2935f63753 100644 --- a/src/mesa/main/marshal.c +++ b/src/mesa/main/marshal.c @@ -111,7 +111,7 @@ _mesa_marshal_ShaderSource(GLuint shader, GLsizei count, measure_ShaderSource_strings(count, string, length, length_tmp); size_t total_cmd_size = fixed_cmd_size + length_size + total_string_length; - if (total_cmd_size <= MARSHAL_MAX_CMD_SIZE) { + if (total_cmd_size <= MARSHAL_MAX_CMD_SIZE && count > 0) { struct marshal_cmd_ShaderSource *cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ShaderSource, total_cmd_size); -- 2.30.2