From 34ca53de77708c02707a00752ae2f1ffe8973118 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 18 Apr 2012 10:31:50 +0200 Subject: [PATCH] isl_merge_divs: handle NULL input Signed-off-by: Sven Verdoolaege --- isl_local_space.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/isl_local_space.c b/isl_local_space.c index 19ae702..20e4070 100644 --- a/isl_local_space.c +++ b/isl_local_space.c @@ -413,8 +413,12 @@ __isl_give isl_mat *isl_merge_divs(__isl_keep isl_mat *div1, { int i, j, k; isl_mat *div = NULL; - unsigned d = div1->n_col - div1->n_row; + unsigned d; + if (!div1 || !div2) + return NULL; + + d = div1->n_col - div1->n_row; div = isl_mat_alloc(div1->ctx, 1 + div1->n_row + div2->n_row, d + div1->n_row + div2->n_row); if (!div) -- 2.7.4