ocl: memory corruption check
Merge pull request #1702 from alalek:ocl_memory_corruption_check