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

java.lang.ArrayIndexOutOfBoundsException #209

Closed
rczhang13028 opened this issue Aug 30, 2016 · 5 comments
Closed

java.lang.ArrayIndexOutOfBoundsException #209

rczhang13028 opened this issue Aug 30, 2016 · 5 comments

Comments

@rczhang13028
Copy link

Description of the problem:

Sorry, My English is poor. Have a function is decodeContinuous of CompoundBarcodeView class.
I use this function for scan qrcode. Sometimes crash。

Which library version are you using? E.g. 3.2.0.
version 3.2.0 . zxing 3.2.1

Which phone/tablet are you using, and which Android version does it run? (e.g. Samsung Galaxy S5,Android 5.0)
Xiaomi:Redmi Note 3:arm64-v8a, Android 5.0.2

Does the same happen on other devices or an emulator?
Meizu:MX5:arm64-v8a,Android 5.1
Meizu:m3:arm64-v8a,Android 5.1
Xiaomi:Redmi Note 2:arm64-v8a,Android 5.0.2

Can you reproduce the issue in the sample project included with the library? If not, can you
provide your own sample project or sample code that produces this error?

i can not reproduce the issue.

In the case of an error do you have a stack trace or adb logs?

java.lang.ArrayIndexOutOfBoundsException: length=460800; index=920320
at com.journeyapps.barcodescanner.n.a(SourceData.java:185)
at com.journeyapps.barcodescanner.n.a(SourceData.java:158)
at com.journeyapps.barcodescanner.n.g(SourceData.java:97)
at com.journeyapps.barcodescanner.i.a(DecoderThread.java:126)
at com.journeyapps.barcodescanner.i.b(DecoderThread.java:134)
at com.journeyapps.barcodescanner.i.a(DecoderThread.java:22)
at com.journeyapps.barcodescanner.i$1.handleMessage(DecoderThread.java:38)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:192)
at android.os.HandlerThread.run(HandlerThread.java:61)

@rczhang13028
Copy link
Author

thanks

@rkistner
Copy link
Member

rkistner commented Sep 1, 2016

Thanks for the report, will look into it.

@rczhang13028
Copy link
Author

Excuse me ,How are you getting along with the work?

@rkistner
Copy link
Member

Added potential fix in 42d09b8.

The crash is from a mismatch between the expected preview resolution, and the size of the preview data received. I'm not sure what the exact cause is - could be a device-specific bug, or an edge case in the library.

If the mismatch is just with a single preview, this change should fix it. If the mismatch is persistent, there is a deeper issue, and scanning will fail (but at least it shouldn't crash anymore).

@rczhang13028
Copy link
Author

thanks

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

No branches or pull requests

2 participants