directx9 – Fog white outlines

I am having weird artifacts when using fog. Some meshes get white outline around it. It happens mostly to objects close to the terrain. Does anyone know what causes this?
Fog white outline. Might need to open in full screen to see it
You might need to open the image in fullscreen to see the issue.

Sadly I am just modding a game and have no access to the c++ source, only the HLSL shader source is available. As such I do not know what exact fog setting get used.