Module: wine Branch: master Commit: 0a61ddbdf1c63a6d3c0cdf8918416065c41f4d10 URL: https://source.winehq.org/git/wine.git/?a=commit;h=0a61ddbdf1c63a6d3c0cdf891...
Author: Akihiro Sagawa sagawa.aki@gmail.com Date: Mon Dec 2 17:57:35 2019 +0330
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
---
dlls/d3d8/tests/visual.c | 2 +- dlls/d3d9/tests/visual.c | 2 +- dlls/wined3d/texture.c | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index 96ab4596a7..4477184b57 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -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); diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index f19bd11607..0a9fb0acc2 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -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); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index d4d90c280a..976235bf60 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -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);