diff options
Diffstat (limited to 'fxbarcode/qrcode')
-rw-r--r-- | fxbarcode/qrcode/BC_QRCoderEncoder.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp index 911730fbe5..4c488418d9 100644 --- a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp +++ b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp @@ -380,8 +380,8 @@ void MergeString(std::vector<ModeStringPair>* result, CBC_QRCoderMode::sBYTE, versionNum, e); if (e != BCExceptionNO) return; - if (element2.first == CBC_QRCoderMode::sBYTE && - element1.second.GetLength() < tmp) { + if (element2.first == CBC_QRCoderMode::sBYTE && tmp >= 0 && + element1.second.GetLength() < static_cast<FX_STRSIZE>(tmp)) { element2.second = element1.second + element2.second; result->erase(result->begin() + i); i--; @@ -399,8 +399,8 @@ void MergeString(std::vector<ModeStringPair>* result, CBC_QRCoderMode::sBYTE, versionNum, e); if (e != BCExceptionNO) return; - if (element2.first == CBC_QRCoderMode::sBYTE && - element1.second.GetLength() < tmp) { + if (element2.first == CBC_QRCoderMode::sBYTE && tmp >= 0 && + element1.second.GetLength() < static_cast<FX_STRSIZE>(tmp)) { element2.second = element1.second + element2.second; result->erase(result->begin() + i); i--; @@ -410,8 +410,8 @@ void MergeString(std::vector<ModeStringPair>* result, CBC_QRCoderMode::sALPHANUMERIC, versionNum, e); if (e != BCExceptionNO) return; - if (element2.first == CBC_QRCoderMode::sALPHANUMERIC && - element1.second.GetLength() < tmp) { + if (element2.first == CBC_QRCoderMode::sALPHANUMERIC && tmp >= 0 && + element1.second.GetLength() < static_cast<FX_STRSIZE>(tmp)) { element2.second = element1.second + element2.second; result->erase(result->begin() + i); i--; |