Allow up to 3 superfluous bits at end of stream
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Fri, 31 Oct 2008 18:49:54 +0000 (18:49 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Fri, 31 Oct 2008 18:49:54 +0000 (18:49 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@659 59b500cc-1b3d-0410-9834-0bbf25fbcc57

core/src/com/google/zxing/qrcode/decoder/DecodedBitStreamParser.java

index 9f6bbf8..2b80fb1 100644 (file)
@@ -63,7 +63,7 @@ final class DecodedBitStreamParser {
     Mode mode;
     do {
       // While still another segment to read...
-      if (bits.available() == 0) {
+      if (bits.available() < 4) {
         // OK, assume we're done. Really, a TERMINATOR mode should have been recorded here
         mode = Mode.TERMINATOR;
       } else {