different threads could allocate the mask buffer and overwrite the same pointer, regression since 2.65