private long getNumEntries(Program program, Address startAddress,
			DataValidationOptions validationOptions) {

		Memory memory = program.getMemory();
		Address addr = startAddress;
		int ordinal = 0;
		for (; addr != null && validRefData(memory, addr); ordinal++) {

			// Each component is either a direct reference or an image base offset.
			Address rtti1Address = getReferencedAddress(program, addr);
			if (rtti1Address == null || !rtti1.isValid(program, rtti1Address, validationOptions)) {
				return ordinal;
			}

			try {
				addr = addr.add(ENTRY_SIZE); // Add the data type size.
			}
			catch (AddressOutOfBoundsException e) {
				return ordinal + 1; // Ordinal hasn't been incremented yet.
			}
		}

		return ordinal;
	}
Determines if the RTTI 1 pointer in the RTTI2 structure is valid.
@param program the program
@param startAddress the address of the RTTI 2 structure
@param pointerIndex index of the element in the array that makes up the RTTI 2.
@param validationOptions options indicating how to perform the validation
@return true if the indicated RTTI1 pointer is valid.
Ghidra/Features/Base/src/main/java/ghidra/app/util/datatype/microsoft/RTTI2DataType.java