Mask(solved)

The cause of the problem was nicely pointed out here, it was the render settings.

Blend is set to cross instead of alpha over.