mirror of
https://github.com/openharmony/third_party_qrcodegen.git
synced 2026-07-18 01:24:39 -04:00
Added an assertion to QrCode.encodeSegmentsAdvanced() in all language versions.
This commit is contained in:
@@ -93,6 +93,8 @@ QrCode QrCode::encodeSegments(const vector<QrSegment> &segs, Ecc ecl,
|
||||
bb.appendBits(seg.getNumChars(), seg.getMode().numCharCountBits(version));
|
||||
bb.insert(bb.end(), seg.getData().begin(), seg.getData().end());
|
||||
}
|
||||
if (bb.size() != static_cast<size_t>(dataUsedBits))
|
||||
throw std::logic_error("Assertion error");
|
||||
|
||||
// Add terminator and pad up to a byte if applicable
|
||||
size_t dataCapacityBits = getNumDataCodewords(version, ecl) * 8;
|
||||
|
||||
Reference in New Issue
Block a user