Issue 1688 reject unexpected macro block code instead of getting into a loop

git-svn-id: https://zxing.googlecode.com/svn/trunk@2807 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen@gmail.com 2013-05-23 07:32:07 +00:00
parent c29816a464
commit 279cf84a13

View file

@ -114,6 +114,10 @@ final class DecodedBitStreamParser {
case BEGIN_MACRO_PDF417_CONTROL_BLOCK:
codeIndex = decodeMacroBlock(codewords, codeIndex, resultMetadata);
break;
case BEGIN_MACRO_PDF417_OPTIONAL_FIELD:
case MACRO_PDF417_TERMINATOR:
// Should not see these outside a macro block
throw FormatException.getFormatInstance();
default:
// Default to text compaction. During testing numerous barcodes
// appeared to be missing the starting mode. In these cases defaulting