ArrayIndexOutOfBoundsException in HybridBinarizer
See original GitHub issueMy app caught the following exception while scanning a barcode with zxing-core 3.2.1:
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=460800; index=460800
at com.google.zxing.common.HybridBinarizer.calculateBlackPoints(HybridBinarizer.java:184)
at com.google.zxing.common.HybridBinarizer.getBlackMatrix(HybridBinarizer.java:79)
at com.google.zxing.BinaryBitmap.getBlackMatrix(BinaryBitmap.java:85)
at com.google.zxing.qrcode.QRCodeReader.decode(QRCodeReader.java:77)
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Developers - ArrayIndexOutOfBoundsException in HybridBinarizer -
My app caught the following exception while scanning a barcode with zxing-core 3.2.1: Caused by: java.lang.ArrayIndexOutOfBoundsException: length=460800 ...
Read more >When I use a third-party application (mogujie), the application ...
When I use a third-party application (mogujie), the application crashes due to an ArrayIndexOutOfBoundsException in the zxing library(Android 12).
Read more >QR code decoder throws ArrayIndexOutOfBoundsException
I got this crash on the Galaxy Ace 2 while testing the 278-bqp-ui branch, but it doesn't look like it's specific to that...
Read more >Android Zxing code throwing exception when used in ...
I am using zxing library for my app which has barcode functionality. My App is running fine on Samsung Galaxy S and S2...
Read more >crash around com.google.zxing.PlanarYUVLuminanceSource ...
ArrayIndexOutOfBoundsException : src.length=610560 srcPos=610799 dst.length=359550 dstPos=273258 length=799 ... getBlackMatrix(HybridBinarizer.java:70)
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@akwizgran To avoid the index out of bounds exception, you should make sure the length of the data array is at least the height times the width of the image before calling the constructor of a luminance source. I’m afraid I don’t know enough about camera drivers to suggest a proper fix for the underlying problem.
I don’t (yet) see how it changes though. It should be set correctly once at the outset.