Skip to content

Commit 813ff37

Browse files
committed
imgproc(ocl): fix RGB2RGBA kernel out of range access
1 parent dcdd6af commit 813ff37

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/imgproc/src/opencl/cvtcolor.cl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,11 @@ __kernel void RGB(__global const uchar* srcptr, int src_step, int src_offset,
877877
{
878878
__global const DATA_TYPE * src = (__global const DATA_TYPE *)(srcptr + src_index);
879879
__global DATA_TYPE * dst = (__global DATA_TYPE *)(dstptr + dst_index);
880+
#if scn == 3
881+
DATA_TYPE_3 src_pix = vload3(0, src);
882+
#else
880883
DATA_TYPE_4 src_pix = vload4(0, src);
884+
#endif
881885

882886
#ifdef REVERSE
883887
dst[0] = src_pix.z;

0 commit comments

Comments
 (0)