mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Issue 1673 assert about division algorithm state to avoid strange infinite loop situation
git-svn-id: https://zxing.googlecode.com/svn/trunk@2690 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
25f00bfdaf
commit
9d1497fd27
|
@ -85,7 +85,7 @@ public final class ReedSolomonDecoder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private GenericGFPoly[] runEuclideanAlgorithm(GenericGFPoly a, GenericGFPoly b, int R)
|
public GenericGFPoly[] runEuclideanAlgorithm(GenericGFPoly a, GenericGFPoly b, int R)
|
||||||
throws ReedSolomonException {
|
throws ReedSolomonException {
|
||||||
// Assume a's degree is >= b's
|
// Assume a's degree is >= b's
|
||||||
if (a.getDegree() < b.getDegree()) {
|
if (a.getDegree() < b.getDegree()) {
|
||||||
|
@ -123,6 +123,10 @@ public final class ReedSolomonDecoder {
|
||||||
}
|
}
|
||||||
|
|
||||||
t = q.multiply(tLast).addOrSubtract(tLastLast);
|
t = q.multiply(tLast).addOrSubtract(tLastLast);
|
||||||
|
|
||||||
|
if (r.getDegree() >= rLast.getDegree()) {
|
||||||
|
throw new IllegalStateException("Division algorithm failed to reduce polynomial?");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int sigmaTildeAtZero = t.getCoefficient(0);
|
int sigmaTildeAtZero = t.getCoefficient(0);
|
||||||
|
|
Loading…
Reference in a new issue