Don't try to allocate a temp array if the preshader has no temps.
--- 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];