Scott Lawrence avatar Scott Lawrence committed e1ed609 Merge

merge changes for storm-1488

Comments (0)

Files changed (1)

indra/llmath/llvolume.cpp

 
 			{
 				U16* n = (U16*) &(norm[0]);
-				for (U32 j = 0; j < num_verts; ++j)
+				if(n)
 				{
-					norm_out->set((F32) n[0], (F32) n[1], (F32) n[2]);
-					norm_out->div(65535.f);
-					norm_out->mul(2.f);
-					norm_out->sub(1.f);
-					norm_out++;
-					n += 3;
+					for (U32 j = 0; j < num_verts; ++j)
+					{
+						norm_out->set((F32) n[0], (F32) n[1], (F32) n[2]);
+						norm_out->div(65535.f);
+						norm_out->mul(2.f);
+						norm_out->sub(1.f);
+						norm_out++;
+						n += 3;
+					}
 				}
 			}
 
 			{
 				U16* t = (U16*) &(tc[0]);
-				for (U32 j = 0; j < num_verts; j+=2)
+				if(t)
 				{
-					if (j < num_verts-1)
+					for (U32 j = 0; j < num_verts; j+=2)
 					{
-						tc_out->set((F32) t[0], (F32) t[1], (F32) t[2], (F32) t[3]);
+						if (j < num_verts-1)
+						{
+							tc_out->set((F32) t[0], (F32) t[1], (F32) t[2], (F32) t[3]);
+						}
+						else
+						{
+							tc_out->set((F32) t[0], (F32) t[1], 0.f, 0.f);
+						}
+
+						t += 4;
+
+						tc_out->div(65535.f);
+						tc_out->mul(tc_range);
+						tc_out->add(min_tc4);
+
+						tc_out++;
 					}
-					else
-					{
-						tc_out->set((F32) t[0], (F32) t[1], 0.f, 0.f);
-					}
-
-					t += 4;
-
-					tc_out->div(65535.f);
-					tc_out->mul(tc_range);
-					tc_out->add(min_tc4);
-
-					tc_out++;
 				}
 			}
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.