From 0d646490f55fc63d398f6deea3d206615207e4ea Mon Sep 17 00:00:00 2001 From: ltqusst Date: Fri, 30 Mar 2018 16:03:04 +0800 Subject: [PATCH] Fix #10557 Fix overflow bugs in conversion from NV12 VA-surface/D3D11texture2D to OpenCL UMat --- modules/core/src/opencl/cvtclr_dx.cl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/core/src/opencl/cvtclr_dx.cl b/modules/core/src/opencl/cvtclr_dx.cl index 5be77e757a..0ca2118c77 100644 --- a/modules/core/src/opencl/cvtclr_dx.cl +++ b/modules/core/src/opencl/cvtclr_dx.cl @@ -92,9 +92,9 @@ void YUV2BGR_NV12_8u( int x = get_global_id(0); int y = get_global_id(1); - if (x < cols) + if (x + 1 < cols) { - if (y < rows) + if (y + 1 < rows) { __global uchar* pDstRow1 = pBGR + mad24(y, bgrStep, mad24(x, NCHANNELS, 0)); __global uchar* pDstRow2 = pDstRow1 + bgrStep; @@ -204,4 +204,4 @@ void BGR2YUV_NV12_8u( write_imagef(imgUV, (int2)((x/2), (y/2)), UV); } } -} \ No newline at end of file +}