In extreme decoder failure case, make sure not to let an IAE propagate up. Turn it into ReaderException.

git-svn-id: https://zxing.googlecode.com/svn/trunk@911 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2009-04-17 21:30:36 +00:00
parent c6fee110c6
commit d08ddbe733

View file

@ -97,7 +97,11 @@ public final class Version {
if (dimension % 4 != 1) { if (dimension % 4 != 1) {
throw ReaderException.getInstance(); throw ReaderException.getInstance();
} }
return getVersionForNumber((dimension - 17) >> 2); try {
return getVersionForNumber((dimension - 17) >> 2);
} catch (IllegalArgumentException iae) {
throw ReaderException.getInstance();
}
} }
public static Version getVersionForNumber(int versionNumber) { public static Version getVersionForNumber(int versionNumber) {