Count constant arrays for the uniform_count. Fixes buffer overflow. default tip
authorRyan C. Gordon <icculus@icculus.org>
Fri, 13 Oct 2017 00:47:22 -0400
changeset 1181 b873f3b0f838
parent 1180 8abc040525ed
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
--- a/mojoshader.c	Thu Oct 12 16:35:50 2017 -0400
+++ b/mojoshader.c	Fri Oct 13 00:47:22 2017 -0400
@@ -11852,8 +11852,8 @@
             {
                 ctx->profile->array_emitter(ctx, var);
                 ctx->uniform_float4_count += var->count;
-                ctx->uniform_count++;
             } // else
+            ctx->uniform_count++;
         } // if
     } // for