Skip to content
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

the function "clip" should be int #9237

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

tc-mb
Copy link
Contributor

@tc-mb tc-mb commented Aug 29, 2024

This function is only used in the interpolation function, and is only used to calculate int data. So it should not be a float function.
And I found that if it is a float function, it will cause the coordinate calculation error of the interpolation function (bicubic_resize), resulting in a precision decrease in the C++ code. And if the coordinate appears at the end, it will cause access to an illegal address and crash.

@saket424
Copy link

@tc-mb
I can confirm that this patch fixed the segmentation violation issue that I reported here #9230
Thanks for your work and fix!

Copy link
Collaborator

@Galunid Galunid left a comment

Choose a reason for hiding this comment

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

The clip(int,int,int) is declared after it's used, so it was picking the clip(float,float,float) instead. float version is not used, so this is a safe fix.

@Galunid Galunid merged commit 7ea8d80 into ggerganov:master Aug 30, 2024
52 checks passed
@tc-mb tc-mb deleted the the-function-"clip"-should-be-int branch August 30, 2024 05:33
dsx1986 pushed a commit to dsx1986/llama.cpp that referenced this pull request Oct 29, 2024
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 15, 2024
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants