-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
set_at now take a long long for y instead of int #2962
base: main
Are you sure you want to change the base?
set_at now take a long long for y instead of int #2962
Conversation
…ve the memory for it
c612961
to
1dc41d6
Compare
def test_line_draw_large_surf_regression(self): | ||
"""Regression test for https://github.com/pygame-community/pygame-ce/issues/2961""" | ||
try: | ||
surface = pygame.Surface((14457, 37200)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the addition of this test. It makes the assumption that the host has enough memory.
A better solution would be a RAM check with pygame.system.get_total_ram
, and then running this test if the RAM is above some threshold, but I'm not a fan of this either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't particularly like it either, but I felt it would be better to have some way to test that it hasn't regressed in the future. I couldn't think of any solution other than "make a gigantic surface" that CI won't have the memory for. I did try to make the surface as small as I could and still cause the segfault without the changes from this branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A follow-up of my message, yes I think it's not the method to follow to add the test.
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. |
Fixes #2961
@ankith26 figured out that it was an
int
overflow when multiplyingsurf->pitch
byy