[PATCH 0/1] MR9344: d2d1: Fix incorrect union member access in radial gradient brush
Fixed union member misuse in d2d_brush_fill_cb() function where radial gradient brush processing incorrectly accessed brush->u.linear.gradient instead of brush->u.radial.gradient. Signed-off-by: YeshunYe <yeyeshun(a)uniontech.com> -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9344
From: YeshunYe <yeyeshun(a)uniontech.com> Fixed union member misuse in d2d_brush_fill_cb() function where radial gradient brush processing incorrectly accessed brush->u.linear.gradient instead of brush->u.radial.gradient. Signed-off-by: YeshunYe <yeyeshun(a)uniontech.com> --- dlls/d2d1/brush.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/d2d1/brush.c b/dlls/d2d1/brush.c index 75cd72b5b9f..50754a2f21a 100644 --- a/dlls/d2d1/brush.c +++ b/dlls/d2d1/brush.c @@ -1445,7 +1445,7 @@ BOOL d2d_brush_fill_cb(const struct d2d_brush *brush, struct d2d_brush_cb *cb) t = sqrtf(s1 - s2); d2d_point_set(&cb->u.radial.rb, t * -sin_theta, t * cos_theta); - cb->u.radial.stop_count = brush->u.linear.gradient->stop_count; + cb->u.radial.stop_count = brush->u.radial.gradient->stop_count; return TRUE; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9344
This merge request was approved by Nikolay Sivov. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9344
Thanks for noticing this. Good thing is that it didn't break anything because 'gradient' field is at the same address for both. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9344#note_120426
On Mon Nov 3 07:22:00 2025 +0000, Nikolay Sivov wrote:
Thanks for noticing this. Good thing is that it didn't break anything because 'gradient' field is at the same address for both. Yep.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9344#note_120428
participants (3)
-
Nikolay Sivov (@nsivov) -
Yeshun Ye (@yeyeshun) -
YeshunYe