Commit 0a61ddbd authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

wined3d: Validate dirty regions in wined3d_texture_add_dirty_region().

parent 3499694f
......@@ -5797,7 +5797,7 @@ static void add_dirty_rect_test(void)
for (i = 0; i < ARRAY_SIZE(oob_rect); ++i)
{
hr = IDirect3DTexture8_AddDirtyRect(tex_src_red, &oob_rect[i]);
todo_wine ok(hr == D3DERR_INVALIDCALL, "[%u] Got unexpected hr %#x.\n", i, hr);
ok(hr == D3DERR_INVALIDCALL, "[%u] Got unexpected hr %#x.\n", i, hr);
hr = IDirect3DTexture8_LockRect(tex_src_red, 0, &locked_rect, &oob_rect[i], 0);
ok(SUCCEEDED(hr), "[%u] Got unexpected hr %#x.\n", i, hr);
hr = IDirect3DTexture8_UnlockRect(tex_src_red, 0);
......
......@@ -19608,7 +19608,7 @@ static void add_dirty_rect_test(void)
for (i = 0; i < ARRAY_SIZE(oob_rect); ++i)
{
hr = IDirect3DTexture9_AddDirtyRect(tex_src_red, &oob_rect[i]);
todo_wine ok(hr == D3DERR_INVALIDCALL, "[%u] Got unexpected hr %#x.\n", i, hr);
ok(hr == D3DERR_INVALIDCALL, "[%u] Got unexpected hr %#x.\n", i, hr);
hr = IDirect3DTexture9_LockRect(tex_src_red, 0, &locked_rect, &oob_rect[i], 0);
ok(SUCCEEDED(hr), "[%u] Got unexpected hr %#x.\n", i, hr);
hr = IDirect3DTexture9_UnlockRect(tex_src_red, 0);
......@@ -1838,7 +1838,14 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
}
if (dirty_region)
{
if (FAILED(wined3d_texture_check_box_dimensions(texture, 0, dirty_region)))
{
WARN("Invalid dirty_region %s specified.\n", debug_box(dirty_region));
return WINED3DERR_INVALIDCALL;
}
FIXME("Ignoring dirty_region %s.\n", debug_box(dirty_region));
}
wined3d_cs_emit_add_dirty_texture_region(texture->resource.device->cs, texture, layer);
......
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