Fix pull request #4913

For REPLACE_ALPHA_NO , it can not always mask out here