Skip to content

set_at now take intptr_t for x, y instead of int, and guards 32-bit architectures #2962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

oddbookworm
Copy link
Member

Fixes #2961
@ankith26 figured out that it was an int overflow when multiplying surf->pitch by y

@oddbookworm oddbookworm added draw pygame.draw bugfix PR that fixes bug labels Jun 30, 2024
@oddbookworm oddbookworm requested a review from a team as a code owner June 30, 2024 16:52
@oddbookworm oddbookworm force-pushed the fix-draw-line-segfault branch from c612961 to 1dc41d6 Compare June 30, 2024 17:43
@bilhox
Copy link
Contributor

bilhox commented Jul 27, 2024

I don't like how the problem is solved, we aren't clamping the line in the clip rect so we have to check if each pixel of the line one by one are outside the clip rect. IMO, the best way to solve this problem is to delimit with new coordinates which part of the line is going to be drawn.

@ankith26 ankith26 marked this pull request as draft August 14, 2024 20:02
@oddbookworm oddbookworm force-pushed the fix-draw-line-segfault branch from 1dc41d6 to 4691737 Compare June 25, 2025 02:21
@oddbookworm oddbookworm marked this pull request as ready for review June 25, 2025 02:43
@oddbookworm oddbookworm changed the title set_at now take a long long for y instead of int set_at now take intptr_t for x, y instead of int, and guards 32-bit architectures Jun 29, 2025
Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks 🎉

@ankith26 ankith26 added this to the 2.5.6 milestone Jun 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR that fixes bug draw pygame.draw
Projects
None yet
Development

Successfully merging this pull request may close these issues.

segfault when we use large coordinates in pygame.draw.line
3 participants