Fixed two bugs, both related to array overflow

release/4.3a0
Manohar Paluri 2010-02-18 22:52:49 +00:00
parent c26219e3d4
commit 2bf4c0ce5b
2 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ namespace gtsam {
/* ************************************************************************* */ /* ************************************************************************* */
Point3h point3h(double X, double Y, double Z, double W) { Point3h point3h(double X, double Y, double Z, double W) {
double data[3]; double data[4];
data[0] = X; data[0] = X;
data[1] = Y; data[1] = Y;
data[2] = Z; data[2] = Z;
@ -53,7 +53,7 @@ namespace gtsam {
/* ************************************************************************* */ /* ************************************************************************* */
Plane3h plane3h(double a, double b, double c, double d) { Plane3h plane3h(double a, double b, double c, double d) {
double data[3]; double data[4];
data[0] = a; data[0] = a;
data[1] = b; data[1] = b;
data[2] = c; data[2] = c;

View File

@ -264,8 +264,8 @@ void svdcmp(double **a, int m, int n, double w[], double **v, bool sort) {
} }
if (sort) { if (sort) {
int *indices1 = new int[n]; int *indices1 = new int[n+1];
int *indices2 = new int[n]; int *indices2 = new int[n+1];
for (int i1 = 1; i1 <= n; i1++) { for (int i1 = 1; i1 <= n; i1++) {
indices1[i1] = i1; indices1[i1] = i1;
indices2[i1] = i1; indices2[i1] = i1;