Copied from a similar thread:
Select the puppet pin effect, enable the puppet pin tool and turn on the mesh. The mesh needs to encompass the whole picture or strange things will happen on the edges. You can expand the size of the mesh by adjusting the ‘expansion’ parameter right next to the ‘show mesh’ tick button. You want it as small as possible yet covering the whole image.
You can also increase the number of triangles in your mesh to reduce artifacting. Bear in mind this will significantly increase rendering times.
https://forums.creativecow.net/thread/2/997061