Mark the image read-only in the C layer if it's created from a read only buffer#29
Conversation
|
Two questions.
|
|
At the moment, we're marking the image read-only in the python layer for anything that's mapped. (There's 2 instances of explicitly mmaping with the read only flag, and we're setting the python read only in frombuffer, no matter the actual buffer permissions). The fact that this is a segfault level issue makes me think that we should be enforcing this at the c level, where the readonly flag is (umm) readonly, and can't be written from python. And prior to 11.2, we didn't have this c level flag. (mainly because there wasn't a convenient place to add this in arrow at the python layer) So right now, this is not going to change anything. However, there's nothing preventing plugins (that we don't write) from using core. map_buffer with a read/write map. There's also a long-standing PR to make mmap not read-only. |
ref python-pillow#8962