Kevin Egan - 2008-10-30

Index: ri/shader.cpp

--- ri/shader.cpp   (revision 1169)
+++ ri/shader.cpp   (working copy)
@@ -709,12 +709,18 @@
                if ((srcs = (const char **) cVariable->defaultValue) != NULL) {
                    int i;
                    for (i=cVariable->numFloats;i>0;i--)    *dests++    =   *srcs++;
-               }
+               } else {
+                   int i;
+                   for (i=cVariable->numFloats;i>0;i--)    *dests++    =   "";
+                }
            } else {
                if ((srcf = (const float *) cVariable->defaultValue) != NULL) {
                    int i;
                    for (i=cVariable->numFloats;i>0;i--)    *destf++    =   *srcf++;
-               }
+               } else {
+                   int i;
+                   for (i=cVariable->numFloats;i>0;i--)    *destf++    =   0.0;
+                }
            }
        } else {

@@ -729,7 +735,15 @@
                    for(n=numVertices*3;n>0;n--) {
                        for (i=0;i<c;i++)   *dests++    =   srcs[i];
                    }
-               }
+               } else {
+                   int         n;
+                   const int   c   =   cVariable->numFloats;
+
+                   // FIXME: We may want to unroll these two loops
+                   for(n=numVertices*3;n>0;n--) {
+                       for (i=0;i<c;i++)   *dests++    =   "";
+                   }
+                }
            } else {
                if ((srcf = (const float *) cVariable->defaultValue) != NULL) {
                    int         n;