summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-02-24 20:46:02 -0500
committerMarge Bot <[email protected]>2020-03-06 01:06:14 +0000
commit57a9c1ee478c5af8cc2f9ffe78b24917deebb1b3 (patch)
treeed0b001c43eabbb578a3c1dc73d1d96efffd232c /src/mesa
parentc5825b7b6e734c991c65246aff59c04ea8cde102 (diff)
glthread: fix a crash with incorrect glShaderSource parameters
Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/marshal.c2
1 files changed, 1 insertions, 1 deletions
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);