Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

MatrixH(float[] elements) throws IndexOutOfRangeException when float[9] #2207

Open
1 of 3 tasks
MathiasGlana opened this issue Sep 25, 2020 · 0 comments · May be fixed by #2211
Open
1 of 3 tasks

MatrixH(float[] elements) throws IndexOutOfRangeException when float[9] #2207

MathiasGlana opened this issue Sep 25, 2020 · 0 comments · May be fixed by #2211

Comments

@MathiasGlana
Copy link

What would you like to submit? (put an 'x' inside the bracket that applies)

  • question
  • bug report
  • feature request

Issue description

public MatrixH(float[] elements) throws a IndexOutOfRangeException when elements is 9 elements long.
Sample code

MatrixH(new float[9] {1, 0, 0, 0, 1, 0, 0, 0, 1}); // gives IndexOutOfRangeException 
else if (elements.Length == 9)
{
    this.elements = new float[8];
    for (int i = 0; i < elements.Length; i++)
    this.elements[i] = (float)(elements[i] / elements[8]);
}

should be

else if (elements.Length == 9)
{
    this.elements = new float[8];
    for (int i = 0; i < this.elements.Length; i++)
    this.elements[i] = (float)(elements[i] / elements[8]);
}
@davidrapan davidrapan linked a pull request Sep 29, 2020 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant