I think perhaps you need to refocus on you now and learn ways to look after yourself better. People will have differing views on this, however NOTHING makes you have an affair unless you want one. Think about it, how many decisions would have to go through your mind when having an affair and at any time did he end/stop it.
What I will state about addiction is that blame is all so common practice for an addict. I’m surprised he hasn’t blamed you yet. If he does please do not listen to the noise.
COCAINE is a stimulant and floods the brain with dopamine, which can lead to hightened senses etc. Try doing some research about the substance online, which can give you some information about the typical behaviour of a coke addict.
Try Al Anon also they help families affected by substance misuse.
There really is no excuse for an affair! There are different types of infidelity, but personally I think there all bad, however if this is a full blown affair then there is nothing other than HIM that chose this regardless of how high on drugs he was.
Look after yourself now.