X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=linear-assignment.c;h=ecffc09be6ec5c1a9646ac152a899f3415f6321d;hb=99c0bdd09de2b04b7a4464e14fe9b65e2152b3d1;hp=9b3e56e283ccb98c57ca8a7b85dcf48b05b15a4f;hpb=e1372c37de9bbca8a96db10fe8ab7b3a420c9108;p=thirdparty%2Fgit.git diff --git a/linear-assignment.c b/linear-assignment.c index 9b3e56e283..ecffc09be6 100644 --- a/linear-assignment.c +++ b/linear-assignment.c @@ -19,6 +19,12 @@ void compute_assignment(int column_count, int row_count, int *cost, int *free_row, free_count = 0, saved_free_count, *pred, *col; int i, j, phase; + if (column_count < 2) { + memset(column2row, 0, sizeof(int) * column_count); + memset(row2column, 0, sizeof(int) * row_count); + return; + } + memset(column2row, -1, sizeof(int) * column_count); memset(row2column, -1, sizeof(int) * row_count); ALLOC_ARRAY(v, column_count);