From 7849e121fe61078c4629996848ac2be92b483b8d Mon Sep 17 00:00:00 2001
From: carlocamilloni <carlo.camilloni@gmail.com>
Date: Tue, 30 Apr 2019 17:10:25 +0200
Subject: [PATCH] SAXS: LGTM

---
 src/isdb/SAXS.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/isdb/SAXS.cpp b/src/isdb/SAXS.cpp
index dcbfd8f4d..2c3ae4406 100644
--- a/src/isdb/SAXS.cpp
+++ b/src/isdb/SAXS.cpp
@@ -756,7 +756,8 @@ void SAXS::setup_midl(vector<double> &r_polar, vector<Vector2d> &qRnm, int &algo
   if(algorithm==-1) log.printf("BESSEL is suboptimal for this system and is being disabled, unless FORCE_BESSEL is used\n");
   if(force_bessel) algorithm=numq-1;
 
-  qRnm.resize(p2*size);
+  unsigned qRnm_size = p2*size;
+  qRnm.resize(qRnm_size);
   //as the legndre polynomials and the exponential term in the basis set expansion are not function of the scattering wavenumber, they can be precomputed
   for(unsigned i=rank; i<size; i+=stride) {
     for(int n=0; n<truncation; n++) {
-- 
GitLab