Mark the image read-only in the C layer if it's created from a read only buffer

This commit is contained in:
wiredfool 2025-05-23 10:22:59 +01:00 committed by Andrew Murray
parent 041acf1344
commit eff667a861

View File

@ -137,6 +137,7 @@ PyImaging_MapBuffer(PyObject *self, PyObject *args) {
} }
} }
im->read_only = view.readonly;
im->destroy = mapping_destroy_buffer; im->destroy = mapping_destroy_buffer;
Py_INCREF(target); Py_INCREF(target);