mirror of
https://github.com/openharmony/third_party_qrcodegen.git
synced 2026-07-16 08:14:28 -04:00
Updated QrCode constructor argument checks in most languages to synchronize logic.
This commit is contained in:
+4
-2
@@ -120,8 +120,10 @@ QrCode::QrCode(int ver, Ecc ecl, const vector<uint8_t> &dataCodewords, int mask)
|
||||
errorCorrectionLevel(ecl),
|
||||
modules (size, vector<bool>(size)), // Initially all white
|
||||
isFunction(size, vector<bool>(size)) {
|
||||
if (ver < MIN_VERSION || ver > MAX_VERSION || mask < -1 || mask > 7)
|
||||
throw std::domain_error("Value out of range");
|
||||
if (ver < MIN_VERSION || ver > MAX_VERSION)
|
||||
throw std::domain_error("Version value out of range");
|
||||
if (mask < -1 || mask > 7)
|
||||
throw std::domain_error("Mask value out of range");
|
||||
size = ver * 4 + 17;
|
||||
|
||||
// Compute ECC, draw modules, do masking
|
||||
|
||||
Reference in New Issue
Block a user