r914: fixed two harmless division by 0

Resolves #326
This commit is contained in:
Heng Li 2019-02-12 19:30:49 -05:00
parent 1739a260fb
commit 32ab6ce15b
3 changed files with 3 additions and 1 deletions

View File

@ -28,6 +28,7 @@ mm128_t *mm_chain_dp(int max_dist_x, int max_dist_y, int bw, int max_skip, int m
mm128_t *b, *w;
if (_u) *_u = 0, *n_u_ = 0;
if (n == 0 || a == 0) return 0;
f = (int32_t*)kmalloc(km, n * 4);
p = (int32_t*)kmalloc(km, n * 4);
t = (int32_t*)kmalloc(km, n * 4);

1
hit.c
View File

@ -449,6 +449,7 @@ void mm_set_mapq(void *km, int n_regs, mm_reg1_t *regs, int min_chain_sc, int ma
int64_t sum_sc = 0;
float uniq_ratio;
int i;
if (n_regs == 0) return;
for (i = 0; i < n_regs; ++i)
if (regs[i].parent == regs[i].id)
sum_sc += regs[i].score;

2
main.c
View File

@ -6,7 +6,7 @@
#include "mmpriv.h"
#include "ketopt.h"
#define MM_VERSION "2.15-r913-dirty"
#define MM_VERSION "2.15-r914-dirty"
#ifdef __linux__
#include <sys/resource.h>