wined3d: Validate dirty regions in wined3d_texture_add_dirty_region().

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Akihiro Sagawa 2019-12-02 17:39:35 +03:30 committed by Alexandre Julliard
parent 3499694f13
commit 0a61ddbdf1
3 changed files with 9 additions and 2 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);