Very strange memory leak in source-to-target image filtering