From d89fb163c6c9dd2d6f0373dda307007a857aa56a Mon Sep 17 00:00:00 2001 From: berak Date: Sat, 21 Apr 2018 11:43:05 +0200 Subject: [PATCH] core: add a check for empty input in inRange() --- modules/core/src/arithm.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/core/src/arithm.cpp b/modules/core/src/arithm.cpp index 45721538bb..10f739c0c1 100644 --- a/modules/core/src/arithm.cpp +++ b/modules/core/src/arithm.cpp @@ -1752,6 +1752,8 @@ void cv::inRange(InputArray _src, InputArray _lowerb, { CV_INSTRUMENT_REGION() + CV_Assert(! _src.empty()); + CV_OCL_RUN(_src.dims() <= 2 && _lowerb.dims() <= 2 && _upperb.dims() <= 2 && OCL_PERFORMANCE_CHECK(_dst.isUMat()), ocl_inRange(_src, _lowerb, _upperb, _dst))