Mesa (master): mesa: fix _math_matrix_copy(), again

Brian Paul brianp at kemper.freedesktop.org
Mon Jul 30 14:31:05 UTC 2012


Module: Mesa
Branch: master
Commit: b51be8786f681210ed865c46065770ba91bc7bcb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b51be8786f681210ed865c46065770ba91bc7bcb

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Jul 30 08:29:08 2012 -0600

mesa: fix _math_matrix_copy(), again

The matrix is 16 GLfloats in size.  Since from->inv is just a pointer (not
an array), sizeof(*from->inv) wasn't right.

---

 src/mesa/math/m_matrix.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c
index 7c4e9fd..00a6c81 100644
--- a/src/mesa/math/m_matrix.c
+++ b/src/mesa/math/m_matrix.c
@@ -1437,7 +1437,7 @@ void
 _math_matrix_copy( GLmatrix *to, const GLmatrix *from )
 {
    memcpy( to->m, from->m, sizeof(Identity) );
-   memcpy(to->inv, from->inv, sizeof(*from->inv));
+   memcpy(to->inv, from->inv, 16 * sizeof(GLfloat));
    to->flags = from->flags;
    to->type = from->type;
 }




More information about the mesa-commit mailing list