# HG changeset patch # User Matti Hamalainen # Date 1560761412 -10800 # Node ID 4f52b7f5fe51cd52819fb96d1835061c919cb503 # Parent dcf9abeec9301c79615303dfb577de9e256160c5 Bail out from the matching search if we exceed the match limits. diff -r dcf9abeec930 -r 4f52b7f5fe51 tools/fanalyze.c --- a/tools/fanalyze.c Mon Jun 17 11:41:33 2019 +0300 +++ b/tools/fanalyze.c Mon Jun 17 11:50:12 2019 +0300 @@ -956,8 +956,10 @@ if (cnt >= optMinMatchLen) { // Match found - dmAddMatchSequence(file1->data + moffs1, cnt, file1, moffs1); - dmAddMatchSequence(file2->data + moffs2, cnt, file2, moffs2); + if (!dmAddMatchSequence(file1->data + moffs1, cnt, file1, moffs1) || + !dmAddMatchSequence(file2->data + moffs2, cnt, file2, moffs2)) + goto done; + moffs1 += cnt; } } @@ -969,6 +971,8 @@ file1->analyzed = TRUE; } +done: + for (int nmatch = 0; nmatch < ndmSequences; nmatch++) { DMMatchSeq *seq = &dmSequences[nmatch];