X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Fcovariance.c;h=b5a4166dfa40643c5a71c88f37ceb7b4c604b1d5;hb=e0cd0149b4b578632eb263a52e93c8a1fed3daba;hp=61f54f50752704e7e9717378574930f3a01b4752;hpb=5f68c60b8283f6a410de20f927e9b12792ea58b3;p=pspp-builds.git diff --git a/src/math/covariance.c b/src/math/covariance.c index 61f54f50..b5a4166d 100644 --- a/src/math/covariance.c +++ b/src/math/covariance.c @@ -601,7 +601,8 @@ covariance_calculate_single_pass (struct covariance *cov) const gsl_matrix * covariance_calculate (struct covariance *cov) { - assert ( cov->state > 0 ); + if ( cov->state <= 0 ) + return NULL; switch (cov->passes) { @@ -681,7 +682,8 @@ covariance_calculate_single_pass_unnormalized (struct covariance *cov) const gsl_matrix * covariance_calculate_unnormalized (struct covariance *cov) { - assert ( cov->state > 0 ); + if ( cov->state <= 0 ) + return NULL; switch (cov->passes) {