isl_mat_transpose: handle NULL input
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Dec 2012 15:56:50 +0000 (16:56 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Dec 2012 15:56:50 +0000 (16:56 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_mat.c

index 6cd90e0..cff8123 100644 (file)
--- a/isl_mat.c
+++ b/isl_mat.c
@@ -909,6 +909,9 @@ struct isl_mat *isl_mat_transpose(struct isl_mat *mat)
        struct isl_mat *transpose = NULL;
        int i, j;
 
+       if (!mat)
+               return NULL;
+
        if (mat->n_col == mat->n_row) {
                mat = isl_mat_cow(mat);
                if (!mat)