You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
medianBlur accessviolation with ksize>=7 and src.ptr()==NULL #8287
OpenCV => 3.2.0 (recent code from github 2017-02-26)
Operating System / Platform => openSUSE Leap 42.2 64 Bit / Windows 7 64 Bit
Compiler => gcc 4.8.5 / Visual Studio 2015
If the function "medianBlur" is called with an invalid image (thus the pointer src.ptr() becomes NULL) and "ksize" is greater or equal "7" the calling application crashes with an accessviolation (German: "Speicherzugriffsfehler").
The crash can be reproduced with a simple python3 script:
```.py
import numpy,cv2
img = numpy.zeros((10,10,1),numpy.uint8)# create arbitrary test image
a = 0 # with a = 1 no crash occurs
slc = img[0:a,:] # create empty slice
cv2.medianBlur(slc, 7) # value >= 7 is essential to crash the program
```
(And unfortunately this crash can NOT be handled by a python try-except block.)
Activity