`ImageDraw.arc()` segfaults on a tuple subclass whose `__len__` is too large
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
Research direction
Start by tracing ImageDraw.arc() from its Python entry point into the coordinate handling used for tuple subclasses; compare that path with the list subclass behavior described in the report. Reproduce with the supplied MyTuple example under Python 3.13.5. Done means the tuple input raises a safe exception instead of crashing the interpreter.
Written by the indexing model from the issue text.
Description
Summary
Passing coordinates as a tuple subclass whose __len__ reports more items than the tuple holds crashes the interpreter.
The same input as a list subclass raises a clean IndexError: list index out of range, so only the tuple path is affected.
Environment
- Pillow 13.0.0
- Python 3.13.5
Reproducer
from PIL import Image, ImageDraw
class MyTuple(tuple):
def __len__(self):
return 10
ImageDraw.Draw(Image.new("RGB", (50, 50))).arc(MyTuple((0.0,)), 0, 90)
Segmentation fault (core dumped)
- Dominant language
- Python
- Stars
- 13.9k
- Forks
- 2.6k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 176
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python-pillow/Pillow
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
python-pillow/Pillow#10370 · 1 comment ·
Maintainers usually reply within 1 day
-
Warn that pre-applying arabic_reshaper + python-bidi corrupts text on a Raqm buildPossibly taken @Syamjith-NK claimed this 63 days ago. OpenDocumentation Font Rendering PNG Third Party Framework
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
python-pillow/Pillow#9907 · 2 comments ·
Maintainers usually reply within 1 day
-
Image.putpixel incorrectly labels supported arguments in type annotationsPossibly taken @radarhere claimed this 191 days ago. OpenPNG
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
python-pillow/Pillow#9584 · 1 comment ·
Maintainers usually reply within 1 day
-
JPEG saved with keep_rgb=True and dpi reopens with incorrect colorsPossibly taken @Muguett-DBY claimed this 4 days ago. Open🤖-assisted JPEG
Difficulty 4/5 1-2 days Newbie friendliness 25/100
python-pillow/Pillow#10344 ·
Maintainers usually reply within 1 day
-
16-bit PNG tRNS key: convert("RGBA") misses the keyed pixel and makes another transparentPossibly taken @Zhuyuyangyy claimed this 1 day ago. OpenConversion
Difficulty 3/5 1-2 days Newbie friendliness 58/100
python-pillow/Pillow#10330 · 4 comments ·
Maintainers usually reply within 1 day
All issues in python-pillow/Pillow
Similar issues
-
predict_file with crop_model duplicates predictions once per imagePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
weecology/DeepForest#1445 ·
-
agent-ready priority: medium status: ready
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
melodic-software/claude-code-plugins#11864 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PolicyEngine/policyengine-uk#2785 ·
Maintainers usually reply within 2 days
-
correction metadata
Difficulty 1/5 Under an hour Newbie friendliness 62/100
acl-org/acl-anthology#10724 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
use-agent-os/agent-os#3739 ·
Maintainers usually reply within 1 day