[gtk/ngl-uninitialized-matrix: 2/2] ngl: Fix an uninitialized read
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ngl-uninitialized-matrix: 2/2] ngl: Fix an uninitialized read
- Date: Sat, 27 Mar 2021 20:25:36 +0000 (UTC)
commit 4a27988cbd838b5cff612ac7d4807d791017cd4d
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Mar 27 16:23:40 2021 -0400
ngl: Fix an uninitialized read
We were using the wrong matrix here.
valgrind pointed this point.
gsk/ngl/gsknglrenderjob.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/gsk/ngl/gsknglrenderjob.c b/gsk/ngl/gsknglrenderjob.c
index 8e4246d8b7..38dbe8f27d 100644
--- a/gsk/ngl/gsknglrenderjob.c
+++ b/gsk/ngl/gsknglrenderjob.c
@@ -399,7 +399,6 @@ static void
extract_matrix_metadata (GskNglRenderModelview *modelview)
{
float dummy;
- graphene_matrix_t m;
gsk_transform_to_matrix (modelview->transform, &modelview->matrix);
@@ -428,14 +427,14 @@ extract_matrix_metadata (GskNglRenderModelview *modelview)
/* TODO: 90% sure this is incorrect. But we should never hit this code
* path anyway. */
graphene_vec3_init (&col1,
- graphene_matrix_get_value (&m, 0, 0),
- graphene_matrix_get_value (&m, 1, 0),
- graphene_matrix_get_value (&m, 2, 0));
+ graphene_matrix_get_value (&modelview->matrix, 0, 0),
+ graphene_matrix_get_value (&modelview->matrix, 1, 0),
+ graphene_matrix_get_value (&modelview->matrix, 2, 0));
graphene_vec3_init (&col2,
- graphene_matrix_get_value (&m, 0, 1),
- graphene_matrix_get_value (&m, 1, 1),
- graphene_matrix_get_value (&m, 2, 1));
+ graphene_matrix_get_value (&modelview->matrix, 0, 1),
+ graphene_matrix_get_value (&modelview->matrix, 1, 1),
+ graphene_matrix_get_value (&modelview->matrix, 2, 1));
modelview->scale_x = graphene_vec3_length (&col1);
modelview->scale_y = graphene_vec3_length (&col2);
@@ -2673,6 +2672,8 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob *job,
else
c = *color;
+ //memset (&lookup, 0, sizeof lookup);
+
lookup.font = (PangoFont *)font;
lookup.scale = (guint) (text_scale * 1024);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]