Skip to content

wechat_qrcode crash in zxing detector #3235

Closed
@BerylLuo

Description

@BerylLuo

crash backtrace:
thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x27fc00008)
frame #0: 0x0000000101443870 void std::__1::__sort<zxing::qrcode::(anonymous namespace)::XComparator&, zxing::Ref<zxing::qrcode::FinderPattern>*>(zxing::Ref<zxing::qrcode::FinderPattern>*, zxing::Ref<zxing::qrcode::FinderPattern>*, zxing::qrcode::(anonymous namespace)::XComparator&) + 1808 frame #1: 0x000000010143185c zxing::qrcode::FinderPatternFinder::selectBestPatterns(zxing::ErrorHandler&) + 1544
frame #2: 0x000000010142e1b0 zxing::qrcode::FinderPatternFinder::getPatternInfosFileMode(zxing::DecodeHints const&, zxing::ErrorHandler&) + 492 frame #3: 0x000000010142d398 zxing::qrcode::FinderPatternFinder::find(zxing::DecodeHints const&, zxing::ErrorHandler&) + 1556
frame #4: 0x000000010145fb3c zxing::qrcode::Detector::detect(zxing::DecodeHints const&, zxing::ErrorHandler&) + 220 frame #5: 0x00000001014a8ea8 zxing::qrcode::QRCodeReader::decodeMore(zxing::Refzxing::BinaryBitmap, zxing::Refzxing::BitMatrix, zxing::DecodeHints, zxing::ErrorHandler&) + 408
frame #6: 0x00000001014a8ac8 zxing::qrcode::QRCodeReader::decode(zxing::Ref<zxing::BinaryBitmap>, zxing::DecodeHints) + 520 frame #7: 0x0000000101485fd8 wechat_qrcode::DecoderMgr::TryDecode(zxing::Refzxing::LuminanceSource, zxing::Refzxing::Result&) + 340
frame #8: 0x0000000101485b60 `wechat_qrcode::DecoderMgr::decodeImage(Justice::JTMat&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&) + 656

I modified if(!isnan(x)) to if(!isnan(x) && x >= 0.0) in line 1125 and line 1130 to solved this problem.
Just woderiny why isnan() function doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions