1) why don't you use `vector<int> tmp(__memory_corruption_check_bytes, __memory_corruption_check_pattern)`???
note: `memset` treats the value to set as an `uchar`, not as an `int`!
2) why don't you use `cv::Ptr<>` instead of `std::vector`? do you need its auto-resize?
note: there are plans to remove all the STL references from OpenCV, so this code adds more work there...