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
importpyarrowaspaimportnumpyasnpimportcv2array=pa.array(np.zeros((100))).to_numpy().reshape((10,10))
assertarray.flags.writeable==False, "Array should be not writable"cv2.rectangle(array,(0,0),(5,5),(255),2)
print(array)
Expected behaviour
Numpy array has a flag indicating if the array is writeable or not.
In the case it is not writeable and the user is trying to write on the array, I would imagine opencv would raise an issue or would use a copy.
Actual behaviour
Opencv write on the array without checking the flag that can raise a segmentation fault.
Steps to reproduce
The following example is a simple example taken from https://github.com/dora-rs/dora , which use the latest pyarrow. You can probably make a numpy only example.
Errors
This can lead to segmentation fault error if the data is not owned by the current process.
I wonder if #728 is linked to this issue.
The text was updated successfully, but these errors were encountered: