From 6a0d004311be6c73ec5b5089c9c2d2a88a99a344 Mon Sep 17 00:00:00 2001 From: Sergey Koren Date: Thu, 21 Dec 2023 09:51:20 -0500 Subject: [PATCH] fix crash when tiglen becomes larger than trimmed template --- src/utgcns/unitigConsensus.C | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utgcns/unitigConsensus.C b/src/utgcns/unitigConsensus.C index e53fd0297..22264f37a 100644 --- a/src/utgcns/unitigConsensus.C +++ b/src/utgcns/unitigConsensus.C @@ -464,6 +464,8 @@ unitigConsensus::generateTemplateStitch(void) { // enforce minimum template length if (templateLen <= 1) templateLen ++; + if (templateLen > tiglen) + templateLen = tiglen-1; if (showAlgorithm()) { fprintf(stderr, "\n");