[cogl/wip/rib/master-next: 35/36] matrix: init flags before tmp _translate in _look_at
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/wip/rib/master-next: 35/36] matrix: init flags before tmp _translate in _look_at
- Date: Mon, 17 Oct 2011 12:48:12 +0000 (UTC)
commit a04bfcde51e902cd5ab467bf8b2421c6863dcae3
Author: Robert Bragg <robert linux intel com>
Date: Mon Oct 17 10:00:13 2011 +0100
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.
cogl/cogl-matrix.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/cogl/cogl-matrix.c b/cogl/cogl-matrix.c
index 0454a49..0d0cf44 100644
--- a/cogl/cogl-matrix.c
+++ b/cogl/cogl-matrix.c
@@ -2108,9 +2108,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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]