Skip to content

Fix harmless ASAN error.#24042

Merged
asmorkalov merged 2 commits intoopencv:4.xfrom
vrabaud:circle
Jul 26, 2023
Merged

Fix harmless ASAN error.#24042
asmorkalov merged 2 commits intoopencv:4.xfrom
vrabaud:circle

Conversation

@vrabaud
Copy link
Copy Markdown
Contributor

@vrabaud vrabaud commented Jul 21, 2023

For an empty radius, &v[0] would be accessed (though the called functions would not use it due to v.size() being 0). Also add checks for emptyness and fix the first element checks, in case we get INT_MAX to compare to.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@asmorkalov asmorkalov self-requested a review July 21, 2023 13:45
@asmorkalov asmorkalov self-assigned this Jul 21, 2023
@asmorkalov asmorkalov added this to the 4.9.0 milestone Jul 21, 2023
vrabaud added 2 commits July 26, 2023 16:08
For an empty radius, &v[0] would be accessed (though the called
functions would not use it due to v.size() being 0).
Also add checks for emptyness and fix the first element checks,
in case we get INT_MAX to compare to.
I added it because we could send 0xFFF... as an input and therefore
not go through but this is a different bug.
@asmorkalov asmorkalov merged commit 94de7e5 into opencv:4.x Jul 26, 2023
@asmorkalov asmorkalov mentioned this pull request Jul 27, 2023
@vrabaud vrabaud deleted the circle branch August 13, 2023 21:38
thewoz pushed a commit to thewoz/opencv that referenced this pull request Jan 4, 2024
Fix harmless ASAN error. opencv#24042

For an empty radius, &v[0] would be accessed (though the called functions would not use it due to v.size() being 0). Also add checks for emptyness and fix the first element checks, in case we get INT_MAX to compare to.

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
thewoz pushed a commit to thewoz/opencv that referenced this pull request May 29, 2024
Fix harmless ASAN error. opencv#24042

For an empty radius, &v[0] would be accessed (though the called functions would not use it due to v.size() being 0). Also add checks for emptyness and fix the first element checks, in case we get INT_MAX to compare to.

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants