mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 13:47:32 +08:00
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.
This commit is contained in:
parent
dcbed8d676
commit
5169c79978
@ -3494,7 +3494,7 @@ void cv::medianBlur( InputArray _src0, OutputArray _dst, int ksize )
|
||||
|
||||
CV_Assert( (ksize % 2 == 1) && (_src0.dims() <= 2 ));
|
||||
|
||||
if( ksize <= 1 )
|
||||
if( ksize <= 1 || _src0.empty() )
|
||||
{
|
||||
_src0.copyTo(_dst);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user