question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ArrayIndexOutOfBoundsException in HybridBinarizer

See original GitHub issue

My 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:closed
  • Created 7 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tanelihuuskonencommented, May 10, 2016

@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.

0reactions
srowencommented, May 9, 2016

I don’t (yet) see how it changes though. It should be set correctly once at the outset.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found