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.
Opencv write on the array without checking the flag that can raise a segmentation fault.
array([[255., 255., 255., 255., 255., 255., 255., 0., 0., 0.],
[255., 255., 255., 255., 255., 255., 255., 0., 0., 0.],
[255., 255., 0., 0., 255., 255., 255., 0., 0., 0.],
[255., 255., 0., 0., 255., 255., 255., 0., 0., 0.],
[255., 255., 255., 255., 255., 255., 255., 0., 0., 0.],
[255., 255., 255., 255., 255., 255., 255., 0., 0., 0.],
[255., 255., 255., 255., 255., 255., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]])
This can lead to segmentation fault error if the data is not owned by the current process.
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.