1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 12:40:35 +00:00

Fix defect detected by coverity scan (avoid null pointer dereference)

This commit is contained in:
Carles Fernandez 2018-08-30 20:22:15 +02:00
parent aa3429ebb2
commit 753dc7241f
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -73,16 +73,9 @@ arma::vec Pvt_Solution::rotateSatellite(double const traveltime, const arma::vec
omegatau = OMEGA_EARTH_DOT * traveltime; omegatau = OMEGA_EARTH_DOT * traveltime;
//--- Build a rotation matrix ---------------------------------------------- //--- Build a rotation matrix ----------------------------------------------
arma::mat R3 = arma::zeros(3, 3); arma::mat R3 = {{cos(omegatau), sin(omegatau), 0.0},
R3(0, 0) = cos(omegatau); {-sin(omegatau), cos(omegatau), 0.0},
R3(0, 1) = sin(omegatau); {0.0, 0.0, 1.0}};
R3(0, 2) = 0.0;
R3(1, 0) = -sin(omegatau);
R3(1, 1) = cos(omegatau);
R3(1, 2) = 0.0;
R3(2, 0) = 0.0;
R3(2, 1) = 0.0;
R3(2, 2) = 1;
//--- Do the rotation ------------------------------------------------------ //--- Do the rotation ------------------------------------------------------
arma::vec X_sat_rot; arma::vec X_sat_rot;
@ -394,19 +387,9 @@ int Pvt_Solution::topocent(double *Az, double *El, double *D, const arma::vec &x
double cb = cos(phi * dtr); double cb = cos(phi * dtr);
double sb = sin(phi * dtr); double sb = sin(phi * dtr);
arma::mat F = arma::zeros(3, 3); arma::mat F = {{-sl, -sb * cl, cb * cl},
{cl, -sb * sl, cb * sl},
F(0, 0) = -sl; {0, 0, cb, sb}};
F(0, 1) = -sb * cl;
F(0, 2) = cb * cl;
F(1, 0) = cl;
F(1, 1) = -sb * sl;
F(1, 2) = cb * sl;
F(2, 0) = 0;
F(2, 1) = cb;
F(2, 2) = sb;
arma::vec local_vector; arma::vec local_vector;