Skip to content

Commit 5169c79

Browse files
committed
fix medianBlur accessviolation
medianBlur called with "empty" source and ksize >= 7 crashes application with accessviolation. With this extra assert this is avoided and the application may normally catch the thrown exception.
1 parent dcbed8d commit 5169c79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/imgproc/src/smooth.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3494,7 +3494,7 @@ void cv::medianBlur( InputArray _src0, OutputArray _dst, int ksize )
34943494

34953495
CV_Assert( (ksize % 2 == 1) && (_src0.dims() <= 2 ));
34963496

3497-
if( ksize <= 1 )
3497+
if( ksize <= 1 || _src0.empty() )
34983498
{
34993499
_src0.copyTo(_dst);
35003500
return;

0 commit comments

Comments
 (0)