diff --git a/src/align.c b/src/align.c index b58b823e..78c8f750 100644 --- a/src/align.c +++ b/src/align.c @@ -454,7 +454,7 @@ int32_t align(AlignedPair* out_2, char* sequence, int32_t sequence_len, while (curr_kmer_idx >= 0 && curr_event_idx >= 0) { // emit alignment //>>>>>>>New Repalcement begin - assert(outIndex < (int)(n_events * 2)); + assert(outIndex < (int)(n_events + sequence_len)); out_2[outIndex].ref_pos = curr_kmer_idx; out_2[outIndex].read_pos = curr_event_idx; outIndex++; diff --git a/src/f5c.c b/src/f5c.c index 319ca4c8..3ced84ee 100644 --- a/src/f5c.c +++ b/src/f5c.c @@ -722,7 +722,7 @@ void event_single(core_t* core,db_t* db, int32_t i) { //allocate memory for the next alignment step db->event_align_pairs[i] = (AlignedPair*)malloc( - sizeof(AlignedPair) * db->et[i].n * 2); //todo : find a good heuristic to save memory + sizeof(AlignedPair) * (db->et[i].n + db->read_len[i])); MALLOC_CHK(db->event_align_pairs[i]); } else{