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

Bound check fixes #3

Merged
merged 2 commits into from Feb 12, 2022
Merged

Bound check fixes #3

merged 2 commits into from Feb 12, 2022

Conversation

mlourakis
Copy link
Contributor

I've been testing ELSED on a video sequence and discovered a couple of memory overrun errors. They were all caused by wrong or missing bound checks which I have fixed here.

Fixed upper bounds
Added upper bound checks for x0, y0 in blerp
@iago-suarez
Copy link
Owner

Dear @mlourakis, thanks a lot for your interest and for the fix. I will try it and if everything runs fine I will integrate it :)

Best,
Iago.

@iago-suarez iago-suarez merged commit a714544 into iago-suarez:main Feb 12, 2022
@iago-suarez
Copy link
Owner

Dear @mlourakis,

Everything runs correctly. Thanks again for your contribution 😃

Best,
Iago.

@mlourakis
Copy link
Contributor Author

You're welcome, thanks for making your code available.

@h1063135843
Copy link

h1063135843 commented Jan 30, 2024

l /= std::sqrt(l[0] * l[0] + l[1] * l[1]);
line 291 in function drawAnchorPoints may also cause segmantion fault due to divide zero.

@iago-suarez
Copy link
Owner

Hi! Thanks a lot for your interest and your observation.

I am actually not sure. The expression will only be zero if the cross product of the starting and ending points in homogeneous coordinates is zero. This only happens if the starting point and the ending pixels are the same, which is impossible by definition in a line segment.

Have you found any case where this is true? If so, could you provide the instructions to reproduce so?

Best,
Iago.

@h1063135843
Copy link

1
just detect this image to reproduce.

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.

None yet

3 participants