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

[cctag] fix (potential) access out of bound error in opencv #180

Merged
merged 4 commits into from
Jan 25, 2022

Conversation

simogasp
Copy link
Member

@simogasp simogasp commented Jan 25, 2022

There is a reported crash when running in debug with access out of bound raised by OpenCV,
In reality, there is no real access to the memory but just the declaration of a pointer that may point outside the memory. All the operations are then made in the safe bound.

The solution is to move the declaration inside the good range.

fix #179

Note: to reproduce this behavior on a non-windows machine the _DEBUG preprocessor must be defined because the assert raising the error is defined based on that definition in OpenCV

@simogasp simogasp added bugfix linux build:windows anything related to the windows build labels Jan 25, 2022
@simogasp simogasp added this to the v1.1.0 milestone Jan 25, 2022
@simogasp simogasp requested a review from griwodz January 25, 2022 10:26
@simogasp
Copy link
Member Author

when approved, I'd like to run the code formatting for this file alone before merging, because it's hard to read (but I didn't want to pollute the PR)

Copy link
Member

@griwodz griwodz left a comment

Choose a reason for hiding this comment

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

I agree that this will avoid the OpenCV boundary check.

@simogasp simogasp merged commit 3367d96 into develop Jan 25, 2022
@simogasp simogasp deleted the fix/debugCrashOutOfBound branch January 25, 2022 14:30
@simogasp simogasp modified the milestones: v1.1.0, v1.0.2 Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix build:windows anything related to the windows build linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cctagDetection works well in ubuntu but failed in windows 10
2 participants