Merge pull request #3484 from Konano:patch-2

fix(wechat_qrcode): fixed memory leaks
pull/3492/head
Alexander Smorkalov 2 years ago committed by GitHub
commit ec406fa474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      modules/wechat_qrcode/src/zxing/qrcode/decoder/decoded_bit_stream_parser.cpp

@ -127,7 +127,10 @@ void DecodedBitStreamParser::decodeHanziSegment(Ref<BitSource> bits_, string& re
while (count > 0) {
// Each 13 bits encodes a 2-byte character
int twoBytes = bits.readBits(13, err_handler);
if (err_handler.ErrCode()) return;
if (err_handler.ErrCode()) {
delete[] buffer;
return;
}
int assembledTwoBytes = ((twoBytes / 0x060) << 8) | (twoBytes % 0x060);
if (assembledTwoBytes < 0x003BF) {
// In the 0xA1A1 to 0xAAFE range

Loading…
Cancel
Save