From a054b53891c2aa7416262bd22d3eeb0d1a8e9f61 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Mon, 17 Oct 2011 10:00:13 +0100 Subject: [PATCH] matrix: init flags before tmp _translate in _look_at In cogl_matrix_look_at we have a tmp CoglMatrix allocated on the stack but we weren't initializing its flags before passing it to cogl_matrix_translate which meant if we were using COGL_DEBUG=matrices we would end up trying to print out an invalid matrix type resulting in a crash when overrunning an array of type names. Reviewed-by: Neil Roberts --- cogl/cogl-matrix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogl/cogl-matrix.c b/cogl/cogl-matrix.c index 7941bb649..f0bcdb795 100644 --- a/cogl/cogl-matrix.c +++ b/cogl/cogl-matrix.c @@ -2107,9 +2107,9 @@ cogl_matrix_look_at (CoglMatrix *matrix, tmp.zw = 0; tmp.ww = 1; - cogl_matrix_translate (&tmp, -eye_position_x, -eye_position_y, -eye_position_z); - tmp.flags = (MAT_FLAG_GENERAL_3D | MAT_DIRTY_TYPE | MAT_DIRTY_INVERSE); + cogl_matrix_translate (&tmp, -eye_position_x, -eye_position_y, -eye_position_z); + cogl_matrix_multiply (matrix, matrix, &tmp); }