 			
 			vertexCopy.position = 0;
 			
+			
+			var newLimit : uint = 0;
+			
 			for (var oldVertexId : uint = 0; oldVertexId < numVertices; ++oldVertexId)
 			{
 				var vertexHash	: uint		= CRC32.computeForByteArrayChunk(vertexCopy, bytesPerVertex);

					newVertexId = newVertexCount++;
					hashToNewVertexId[vertexHash] = newVertexId;
					
					if (newVertexId != oldVertexId)
					{
						var oldOffset	: uint = oldVertexId * dwordsPerVertex;
						var newOffset	: uint = newVertexId * dwordsPerVertex;
						var newLimit	: uint = newOffset + dwordsPerVertex;
						
						for (; newOffset < newLimit; ++newOffset, ++oldOffset)
							vertexData[newOffset] = vertexData[oldOffset];

		private static const INDEX_LIMIT	: uint = 524270;
		private static const VERTEX_LIMIT	: uint = 65535;
		
		public static function isValid(indexData		: Vector.<uint>,
									   vertexData		: Vector.<Number>,
									   dwordsPerVertex	: uint = 3) : Boolean
		{
			var numIndices	: uint = indexData.length;
			var numVertices	: uint = vertexData.length;
			
			for (var indexId : uint = 0; indexId < numIndices; ++indexId)
				if (indexData[indexId] >= numVertices)
					return false;
			
			return true;
		}
		
		
		/**
		 * Split vertex and index buffers too big the be rendered.
		 * The index stream limit is 524270, the vertex stream limit is 65536.
