X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=isl_mat.c;h=16a79f755a23e51b4dac4e37a69041108d2a994c;hb=27b230c534bdef3411e89011354b8606514f8614;hp=a4b6e5a2406128724f66f3ff67bff6353e17eb32;hpb=64736c6f748bace12e7f6f152eb7b1fa09b83703;p=platform%2Fupstream%2Fisl.git diff --git a/isl_mat.c b/isl_mat.c index a4b6e5a..16a79f7 100644 --- a/isl_mat.c +++ b/isl_mat.c @@ -1,7 +1,7 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven * - * Use of this software is governed by the GNU LGPLv2.1 license + * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium @@ -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) @@ -1242,6 +1245,9 @@ struct isl_mat *isl_mat_drop_cols(struct isl_mat *mat, unsigned col, unsigned n) { int r; + if (n == 0) + return mat; + mat = isl_mat_cow(mat); if (!mat) return NULL;