summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorSean Owen <srowen@gmail.com>2021-08-31 04:06:44 +0300
committerSean Owen <srowen@gmail.com>2021-08-31 04:06:44 +0300
commitdc6c8ea4222284f970f4e04dbab11162cc991cda (patch)
treeeeed98696c0a9d419211af55e113890b081425dc /core/src
parent73a3c3a704e56aed4fe60c31c706a4e0b1bd407e (diff)
downloadzxing-dc6c8ea4222284f970f4e04dbab11162cc991cda.tar.xz
Possible fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37868
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/java/com/google/zxing/pdf417/decoder/ec/ErrorCorrection.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/src/main/java/com/google/zxing/pdf417/decoder/ec/ErrorCorrection.java b/core/src/main/java/com/google/zxing/pdf417/decoder/ec/ErrorCorrection.java
index e34cb7fea..06bd06d82 100644
--- a/core/src/main/java/com/google/zxing/pdf417/decoder/ec/ErrorCorrection.java
+++ b/core/src/main/java/com/google/zxing/pdf417/decoder/ec/ErrorCorrection.java
@@ -166,6 +166,9 @@ public final class ErrorCorrection {
ModulusPoly errorLocator,
int[] errorLocations) {
int errorLocatorDegree = errorLocator.getDegree();
+ if (errorLocatorDegree < 1) {
+ return new int[0];
+ }
int[] formalDerivativeCoefficients = new int[errorLocatorDegree];
for (int i = 1; i <= errorLocatorDegree; i++) {
formalDerivativeCoefficients[errorLocatorDegree - i] =