layer index was being obtained for loop data types but we referenced Tessface data types NULLing those out since only the data offsets are used in edit mode and address sanitizer complains about freed memory access. Also minor comment in texpainting