Commit ca03802a authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Only read "*rect_count" when "rects" is non-NULL in…

wined3d: Only read "*rect_count" when "rects" is non-NULL in wined3d_device_context_get_scissor_rects() (Valgrind). When "rects" is NULL, "*rect_count" is potentially uninitialised. That's fairly benign because the resulting "count" value is inconsequential in that case, but it's also unnecessary, and easy to avoid. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent e7ebe3d8
......@@ -1722,8 +1722,7 @@ void CDECL wined3d_device_context_get_scissor_rects(const struct wined3d_device_
TRACE("context %p, rect_count %p, rects %p.\n", context, rect_count, rects);
count = rect_count ? min(*rect_count, state->scissor_rect_count) : 1;
if (count && rects)
if (rects && (count = rect_count ? min(*rect_count, state->scissor_rect_count) : 1))
memcpy(rects, state->scissor_rects, count * sizeof(*rects));
if (rect_count)
*rect_count = state->scissor_rect_count;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment