From 234ad8fbee0c9e2c25ea4e62d7b23a99b4b4fbd7 Mon Sep 17 00:00:00 2001 From: Vladislav Sovrasov Date: Wed, 14 Jun 2017 13:57:07 +0300 Subject: [PATCH] photo: add assertion on empty image in denoising --- modules/photo/src/denoising.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/photo/src/denoising.cpp b/modules/photo/src/denoising.cpp index ebf345c827..ee9e57331e 100644 --- a/modules/photo/src/denoising.cpp +++ b/modules/photo/src/denoising.cpp @@ -116,6 +116,7 @@ void cv::fastNlMeansDenoising( InputArray _src, OutputArray _dst, const std::vec CV_INSTRUMENT_REGION() int hn = (int)h.size(), type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); + CV_Assert(!_src.empty()); CV_Assert(hn == 1 || hn == cn); Size src_size = _src.size();