Skip to content

Commit cdf2a59

Browse files
committed
canny: disallow broken inplace arguments
1 parent a84a5e8 commit cdf2a59

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/imgproc/src/canny.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,9 @@ void Canny( InputArray _src, OutputArray _dst,
972972

973973
const Size size = _src.size();
974974

975+
// we don't support inplace parameters in case with RGB/BGR src
976+
CV_Assert((_dst.getObj() != _src.getObj() || _src.type() == CV_8UC1) && "Inplace parameters are not supported");
977+
975978
_dst.create(size, CV_8U);
976979

977980
if (!L2gradient && (aperture_size & CV_CANNY_L2_GRADIENT) == CV_CANNY_L2_GRADIENT)

0 commit comments

Comments
 (0)