Commit e37b9c74 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Avoid potential out-of-bounds memory access in surface_cpu_blt_colour_fill().

Draw rects are derived from the current viewport. It is possible to produce a clear operation with a draw rect which lies completely outside of one of render targets in D3D9. It seems that we never use the CPU blitter for D3D9 render target clears, so it might not be a problem in practice. Signed-off-by: 's avatarJózef Kucia <jkucia@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 25ced030
...@@ -2970,8 +2970,8 @@ static void surface_cpu_blt_colour_fill(struct wined3d_rendertarget_view *view, ...@@ -2970,8 +2970,8 @@ static void surface_cpu_blt_colour_fill(struct wined3d_rendertarget_view *view,
c = wined3d_format_convert_from_float(view->format, colour); c = wined3d_format_convert_from_float(view->format, colour);
bpp = view->format->byte_count; bpp = view->format->byte_count;
w = min(box->right, view->width) - box->left; w = min(box->right, view->width) - min(box->left, view->width);
h = min(box->bottom, view->height) - box->top; h = min(box->bottom, view->height) - min(box->top, view->height);
texture = texture_from_resource(view->resource); texture = texture_from_resource(view->resource);
map_binding = texture->resource.map_binding; map_binding = texture->resource.map_binding;
......
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