Sort:  

But a company could take an open source invention and patent it.

But how is this possible if it is already existing? It's not the companies invention so they shouldn't be able to patent it!

A patent gives its owner the right to exclude others from
making, using, and selling the claimed invention. Thus,
patent rights give a patentee great control over who uses
his invention. In contrast, the basic idea behind distributing
software under an Open Source license is that anyone
should be able to view and use the “source code” of the
computer program and modify it for his own purposes.
(The source code is the human readable version of the
software.) The author of the program must make the source
code available to others. Anyone can modify the source
code without obtaining permission from the author. A
business decision to distribute software under an Open
Source license affects how the author of the software may
be able to use his patent rights, but does not affect whether
he can or should apply for patent protection. A business
decision to release software under an open source license
(or to incorporate such software in a proprietary product)
may grant certain patent licenses to people who receive the
software, and the patent owner cannot control who these
receivers will be.

https://www.fenwick.com/FenwickDocuments/Patent_Rights.pdf