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] =