On the surface it appears to read that It would not be adultery if someone divorced their spouse due to infidelity and married another, however, this seems inconsistent with Catholic teaching on divorce. As with all things in Scripture there is usually more to the story. I looked up the footnotes on this and related verses in the New American Bible.
The same passage occurs also in Matthew 5:32 and the following are the footnotes on that passage:
It would appear that in the original context of the writing there were circumstances in the community which made exceptions to divorce allowed. However, in normal circumstances divorce is not permitted in a completely valid marriage.