diff --git a/modules/imgcodecs/src/loadsave.cpp b/modules/imgcodecs/src/loadsave.cpp index c8fcbea7ee..bd87c379ab 100644 --- a/modules/imgcodecs/src/loadsave.cpp +++ b/modules/imgcodecs/src/loadsave.cpp @@ -226,8 +226,10 @@ static ImageDecoder findDecoder( const String& filename ) { FILE* f= fopen( filename.c_str(), "rb" ); /// in the event of a failure, return an empty image decoder - if( !f ) + if( !f ) { + CV_LOG_WARNING(NULL, "imread_('" << filename << "'): can't open/read file: check file path/integrity"); return ImageDecoder(); + } // read the file signature String signature(maxlen, ' '); diff --git a/modules/photo/src/seamless_cloning.cpp b/modules/photo/src/seamless_cloning.cpp index d09203577b..d21a3f21fd 100644 --- a/modules/photo/src/seamless_cloning.cpp +++ b/modules/photo/src/seamless_cloning.cpp @@ -67,6 +67,7 @@ static Mat checkMask(InputArray _mask, Size size) void cv::seamlessClone(InputArray _src, InputArray _dst, InputArray _mask, Point p, OutputArray _blend, int flags) { CV_INSTRUMENT_REGION(); + CV_Assert(!_src.empty()); const Mat src = _src.getMat(); const Mat dest = _dst.getMat();