From: srowen Date: Thu, 6 Nov 2008 19:14:48 +0000 (+0000) Subject: Small additional error check in decoder X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;ds=sidebyside;h=3f2e24cf5d35727037e02022d2622089563c6745;p=zxing.git Small additional error check in decoder git-svn-id: http://zxing.googlecode.com/svn/trunk@674 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- diff --git a/core/src/com/google/zxing/datamatrix/detector/Detector.java b/core/src/com/google/zxing/datamatrix/detector/Detector.java index 28c727e0..aa0b426f 100644 --- a/core/src/com/google/zxing/datamatrix/detector/Detector.java +++ b/core/src/com/google/zxing/datamatrix/detector/Detector.java @@ -129,6 +129,10 @@ public final class Detector { } } + if (maybeTopLeft == null || bottomLeft == null || maybeBottomRight == null) { + throw new ReaderException("Could not find three corners"); + } + // Bottom left is correct but top left and bottom right might be switched ResultPoint[] corners = new ResultPoint[] { maybeTopLeft, bottomLeft, maybeBottomRight }; // Use the dot product trick to sort them out