Browse Source

prevent crash if Col==-1

pre-master-46
Holger Vogt 6 years ago
parent
commit
80ad645b49
  1. 5
      src/maths/sparse/spsmp.c

5
src/maths/sparse/spsmp.c

@ -460,6 +460,11 @@ SMPfindElt(SMPmatrix *Matrix, int Row, int Col, int CreateIfMissing)
assert( IS_SPARSE( Matrix ) );
Row = Matrix->ExtToIntRowMap[Row];
Col = Matrix->ExtToIntColMap[Col];
if (Col == -1)
/* No element available */
return NULL;
Element = Matrix->FirstInCol[Col];
Element = spcFindElementInCol(Matrix, &Element, Row, Col, CreateIfMissing);
return Element;

Loading…
Cancel
Save