Skip to content

Use borrowed data when exporting an image created by Image.fromarrow - #9897

Open
lazerg wants to merge 2 commits into
python-pillow:mainfrom
lazerg:fix/issue-9896-arrow-borrowed-export
Open

Use borrowed data when exporting an image created by Image.fromarrow#9897
lazerg wants to merge 2 commits into
python-pillow:mainfrom
lazerg:fix/issue-9896-arrow-borrowed-export

Conversation

@lazerg

@lazerg lazerg commented Aug 24, 2026

Copy link
Copy Markdown

Resolves #9896

An image created by Image.fromarrow() borrows its data, so block and blocks are both NULL and only the row pointers in image are set. export_single_channel_array() and export_fixed_pixel_array() fall back to blocks[0].ptr when block is NULL, which dereferenced NULL and crashed on pa.array(im).

A borrowed array is only accepted when its length matches the image, so the rows are contiguous and the export can start from the first one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exporting an image created by Image.fromarrow with __arrow_c_array__ crashes with a segmentation fault

1 participant