Fixed incorrect pointer conversion for in-place threshold
Merge pull request #3101 from akarsakov:ipp_thresh_fix