You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Sorry, the source project is too complicated so I can't extract the sample code. The weird thing is that crash appears when decoding images asynchronously, but not when decoding single one image.
Follow the backtrace I try to print a->getX() and b->getX() in line113, both of it is "nan". I guess the reason is isnan() in line 1125 and 1130 doesn't work, so pushed nan coordinate in possibleCenters_ . After I modify the if-condition according to line 1089 and 1116, the crash no longer occurs.
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&) + 1544frame #2: 0x000000010142e1b0
zxing::qrcode::FinderPatternFinder::getPatternInfosFileMode(zxing::DecodeHints const&, zxing::ErrorHandler&) + 492 frame #3: 0x000000010142d398
zxing::qrcode::FinderPatternFinder::find(zxing::DecodeHints const&, zxing::ErrorHandler&) + 1556frame #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&) + 408frame #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&) + 340frame #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))
toif(!isnan(x) && x >= 0.0)
in line 1125 and line 1130 to solved this problem.Just woderiny why
isnan()
function doesn't work.opencv_contrib/modules/wechat_qrcode/src/zxing/qrcode/detector/finder_pattern_finder.cpp
Line 1125 in b8e4061
The text was updated successfully, but these errors were encountered: