From 2cf3ac4ee9401cf362c958c1e7ee01eac8aa7db0 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 13 Oct 2017 00:47:22 -0400 Subject: [PATCH] Count constant arrays for the uniform_count. Fixes buffer overflow. This one got found by AFL, too, but it's a legit bug that can happen with legit shaders. --- mojoshader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mojoshader.c b/mojoshader.c index f0938bd6..255d68a6 100644 --- a/mojoshader.c +++ b/mojoshader.c @@ -11852,8 +11852,8 @@ static void process_definitions(Context *ctx) { ctx->profile->array_emitter(ctx, var); ctx->uniform_float4_count += var->count; - ctx->uniform_count++; } // else + ctx->uniform_count++; } // if } // for