mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Generate proper FormatException on QR code with bad structured append segment
C++ port of http://code.google.com/p/zxing/source/detail?r=2367 / http://code.google.com/p/zxing/issues/detail?id=1324 git-svn-id: https://zxing.googlecode.com/svn/trunk@2484 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
d7b0f2cb82
commit
3e1491d850
|
@ -364,6 +364,9 @@ DecodedBitStreamParser::decode(ArrayRef<unsigned char> bytes,
|
||||||
// We do little with FNC1 except alter the parsed result a bit according to the spec
|
// We do little with FNC1 except alter the parsed result a bit according to the spec
|
||||||
fc1InEffect = true;
|
fc1InEffect = true;
|
||||||
} else if (mode == &Mode::STRUCTURED_APPEND) {
|
} else if (mode == &Mode::STRUCTURED_APPEND) {
|
||||||
|
if (bits.available() < 16) {
|
||||||
|
throw new FormatException();
|
||||||
|
}
|
||||||
// not really supported; all we do is ignore it
|
// not really supported; all we do is ignore it
|
||||||
// Read next 8 bits (symbol sequence #) and 8 bits (parity data), then continue
|
// Read next 8 bits (symbol sequence #) and 8 bits (parity data), then continue
|
||||||
bits.readBits(16);
|
bits.readBits(16);
|
||||||
|
|
Loading…
Reference in a new issue