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

Index out of bounds in FitQadrilateralToPoints try_get_range #36

Open
dankirkham opened this issue Oct 27, 2023 · 4 comments
Open

Index out of bounds in FitQadrilateralToPoints try_get_range #36

dankirkham opened this issue Oct 27, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@dankirkham
Copy link

panicked at /Users/dan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rxing-0.4.9/src/common/cpp_essentials/concentric_finder.rs:393:25:
slice index starts at 18 but ends at 17
...

This will happen occasionally while trying to detecting codes in wasm.

@dankirkham
Copy link
Author

I made sure that my luma input was a square image and I am able to scan barcodes now. I have not encountered the error since.

@hschimke
Copy link
Collaborator

I'll look into this. Do you happen to have any images that trigger the error?

@hschimke hschimke self-assigned this Oct 28, 2023
@hschimke hschimke added the bug Something isn't working label Oct 28, 2023
@hschimke
Copy link
Collaborator

I have a potential solution, but it only addresses the error and not whatever root cause results in it happening. If you have an image that causes it you can safely upload to be added to the test suite that would be very helpful.

Alternatively, if your use-case is images that you do not want public and cannot share, I can provide a GitHub branch with the potential solution for you to test.

hschimke added a commit that referenced this issue Nov 6, 2023
A potential resolution to Issue #36. In some cases the array positions suggested by the corner_positions array may be out of bounds for the points array. To resolve this, guard against out of bounds checks. In other cases, where the positions are matched, guard against having the start position of a slice go beyond the end position of the slice.
@hschimke
Copy link
Collaborator

hschimke commented Nov 6, 2023

@dankirkham I bundled this, and a few other changes, into rxing 0.4.11, which is the backing version for the NPM package version 0.1.26. If you continue to see the issue please reach out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants