mojoshader_effects.c
changeset 1047 6b92ce2fc809
parent 1046 097aefb03885
child 1053 513af64373ad
--- a/mojoshader_effects.c	Wed Jun 01 13:22:21 2011 -0400
+++ b/mojoshader_effects.c	Wed Jun 01 13:22:55 2011 -0400
@@ -20,8 +20,12 @@
     //  opcodes in the preshader instruction set (at the moment, at least).
     const int scalarstart = (int) MOJOSHADER_PRESHADEROP_SCALAR_OPS;
 
-    double *temps = (double *) alloca(sizeof (double) * preshader->temp_count);
-    memset(temps, '\0', sizeof (double) * preshader->temp_count);
+    double *temps = NULL;
+    if (preshader->temp_count > 0)
+    {
+        temps = (double *) alloca(sizeof (double) * preshader->temp_count);
+        memset(temps, '\0', sizeof (double) * preshader->temp_count);
+    } // if
 
     double dst[4];
     double src[3][4];