aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/MPRealSupport
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-07-18 14:19:18 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-07-18 14:19:18 +0200
commit36e6c9064fc68d5c47473f6d251da10e96ad42b3 (patch)
tree4ecbff831644aa27d1f0614235ef4046981abfd7 /unsupported/Eigen/MPRealSupport
parenta325d1cb1e607c36d602b1cad9a57b05c60050fa (diff)
bug #770: fix out of bounds access
Diffstat (limited to 'unsupported/Eigen/MPRealSupport')
-rw-r--r--unsupported/Eigen/MPRealSupport5
1 files changed, 4 insertions, 1 deletions
diff --git a/unsupported/Eigen/MPRealSupport b/unsupported/Eigen/MPRealSupport
index 35d77e5bd..0584e470e 100644
--- a/unsupported/Eigen/MPRealSupport
+++ b/unsupported/Eigen/MPRealSupport
@@ -157,9 +157,12 @@ int main()
void operator()(mpreal* res, Index resStride, const mpreal* blockA, const mpreal* blockB, Index rows, Index depth, Index cols, mpreal alpha,
Index strideA=-1, Index strideB=-1, Index offsetA=0, Index offsetB=0)
{
+ if(rows==0 || cols==0 || depth==0)
+ return;
+
mpreal acc1(0,mpfr_get_prec(blockA[0].mpfr_srcptr())),
tmp (0,mpfr_get_prec(blockA[0].mpfr_srcptr()));
-
+
if(strideA==-1) strideA = depth;
if(strideB==-1) strideB = depth;