Issue 1324 Generate proper FormatException on QR code with bad structured append segment

git-svn-id: https://zxing.googlecode.com/svn/trunk@2367 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2012-08-03 22:07:05 +00:00
parent 2696e58e07
commit d52fd6879e

View file

@ -80,6 +80,9 @@ final class DecodedBitStreamParser {
// We do little with FNC1 except alter the parsed result a bit according to the spec
fc1InEffect = true;
} else if (mode == Mode.STRUCTURED_APPEND) {
if (bits.available() < 16) {
throw FormatException.getFormatInstance();
}
// not really supported; all we do is ignore it
// Read next 8 bits (symbol sequence #) and 8 bits (parity data), then continue
bits.readBits(16);