Skip to content

fix crash when the source image is less than 3 pixels width/height #476

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

Merged
merged 1 commit into from
Jan 6, 2023

Conversation

liulex
Copy link
Contributor

@liulex liulex commented Jan 6, 2023

If the last witdh or height of the last layer is less than N, it would create another layer with empty image and cause crash.

@axxel
Copy link
Collaborator

axxel commented Jan 6, 2023

for that crash to happen you would need to call it with threshold < 3, right? That value would make absolutely no sens. The smallest meaningful value would be in the order of 100.

@liulex
Copy link
Contributor Author

liulex commented Jan 6, 2023

No, it's not the threshold, it's the N, which has a value of 3 and cannot be configured.

@axxel
Copy link
Collaborator

axxel commented Jan 6, 2023

Maybe I understand now: your image is e.g. 500x1 pixels big? So one side is >threshold, the other <3?

@liulex
Copy link
Contributor Author

liulex commented Jan 6, 2023

Suppose the threshold is 500, a 600x1 image would cause the crash without the fix.

@liulex
Copy link
Contributor Author

liulex commented Jan 6, 2023

Yes.

@axxel axxel merged commit 86b253d into zxing-cpp:master Jan 6, 2023
@axxel
Copy link
Collaborator

axxel commented Jan 6, 2023

Thanks for the patch and the explanation.

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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy