File 0009-Do-Not-Merge-d2d1-extra-asserts-for-last-change.patch of Package wine

From 1ad14f64e58ab336442e2f729cade7b349a8ea31 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Fri, 7 Jan 2022 18:05:11 +0100
Subject: [PATCH 09/10] Do-Not-Merge: d2d1: extra asserts for last change

---
 dlls/d2d1/geometry.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c
index 61952fdf782..c2a7db7a045 100644
--- a/dlls/d2d1/geometry.c
+++ b/dlls/d2d1/geometry.c
@@ -2007,6 +2007,7 @@ static BOOL d2d_geometry_intersect_bezier_line(struct d2d_geometry *geometry,
     p[0] = &figure->vertices[idx_p->vertex_idx];
     p[1] = &figure->bezier_controls[idx_p->control_idx];
     next = idx_p->vertex_idx + 1;
+    assert(next < figure->vertex_count);
     p[2] = &figure->vertices[next];
 
     figure = &geometry->u.path.figures[idx_q->figure_idx];
@@ -2083,12 +2084,14 @@ static BOOL d2d_geometry_intersect_bezier_bezier(struct d2d_geometry *geometry,
     p[0] = &figure->vertices[idx_p->vertex_idx];
     p[1] = &figure->bezier_controls[idx_p->control_idx];
     next = idx_p->vertex_idx + 1;
+    assert(next < figure->vertex_count);
     p[2] = &figure->vertices[next];
 
     figure = &geometry->u.path.figures[idx_q->figure_idx];
     q[0] = &figure->vertices[idx_q->vertex_idx];
     q[1] = &figure->bezier_controls[idx_q->control_idx];
     next = idx_q->vertex_idx + 1;
+    assert(next < figure->vertex_count);
     q[2] = &figure->vertices[next];
 
     d2d_rect_get_bezier_segment_bounds(&p_bounds, p[0], p[1], p[2], start_p, end_p);
@@ -2172,6 +2175,7 @@ static BOOL d2d_geometry_apply_intersections(struct d2d_geometry *geometry,
         p[0] = &figure->vertices[inter->vertex_idx + vertex_offset];
         p[1] = &figure->bezier_controls[inter->control_idx + control_offset];
         next = inter->vertex_idx + vertex_offset + 1;
+        assert(next < figure->vertex_count);
         p[2] = &figure->vertices[next];
 
         d2d_point_lerp(&q[0], p[0], p[1], t);
@@ -3004,11 +3008,13 @@ static BOOL d2d_geometry_check_bezier_overlap(struct d2d_geometry *geometry,
     float det, t;
 
     figure = &geometry->u.path.figures[idx_p->figure_idx];
+    assert((idx_p->vertex_idx + 1) < figure->vertex_count);
     a[0] = &figure->vertices[idx_p->vertex_idx];
     a[1] = &figure->bezier_controls[idx_p->control_idx];
     a[2] = &figure->vertices[idx_p->vertex_idx + 1];
 
     figure = &geometry->u.path.figures[idx_q->figure_idx];
+    assert((idx_q->vertex_idx + 1) < figure->vertex_count);
     b[0] = &figure->vertices[idx_q->vertex_idx];
     b[1] = &figure->bezier_controls[idx_q->control_idx];
     b[2] = &figure->vertices[idx_q->vertex_idx + 1];
@@ -3081,6 +3087,8 @@ static float d2d_geometry_bezier_ccw(struct d2d_geometry *geometry, const struct
     const struct d2d_figure *figure = &geometry->u.path.figures[idx->figure_idx];
     size_t next = idx->vertex_idx + 1;
 
+    assert(next < figure->vertex_count);
+
     return d2d_point_ccw(&figure->vertices[idx->vertex_idx],
             &figure->bezier_controls[idx->control_idx], &figure->vertices[next]);
 }
@@ -3096,6 +3104,7 @@ static BOOL d2d_geometry_split_bezier(struct d2d_geometry *geometry, const struc
     p[0] = &figure->vertices[idx->vertex_idx];
     p[1] = &figure->bezier_controls[idx->control_idx];
     next = idx->vertex_idx + 1;
+    assert(next < figure->vertex_count);
     p[2] = &figure->vertices[next];
 
     d2d_point_lerp(&q[0], p[0], p[1], 0.5f);
-- 
2.34.1

openSUSE Build Service is sponsored by