[PATCH 06/10] d3drm: Validate that the transformation is affine in d3drm_frame3_AddTransform().
From: Jeff Smith <whydoubt(a)gmail.com> Signed-off-by: Jeff Smith <whydoubt(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> --- This supersedes patch 166698. dlls/d3drm/frame.c | 3 +++ dlls/d3drm/tests/d3drm.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/dlls/d3drm/frame.c b/dlls/d3drm/frame.c index b4c7e995228..9b38a296449 100644 --- a/dlls/d3drm/frame.c +++ b/dlls/d3drm/frame.c @@ -974,6 +974,9 @@ static HRESULT WINAPI d3drm_frame3_AddTransform(IDirect3DRMFrame3 *iface, TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix); + if (m->_14 != 0.0f || m->_24 != 0.0f || m->_34 != 0.0f || m->_44 != 1.0f) + return D3DRMERR_BADVALUE; + switch (type) { case D3DRMCOMBINE_REPLACE: diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index 9494603b990..bbec35bc0a2 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -2821,6 +2821,10 @@ static void test_frame_transform(void) 0.0f, 0.0f, 2.0f, 0.0f, 3.0f, 3.0f, 3.0f, 1.0f, 1); + add_matrix[3][3] = 2.0f; + hr = IDirect3DRMFrame_AddTransform(frame, D3DRMCOMBINE_REPLACE, add_matrix); + ok(hr == D3DRMERR_BADVALUE, "Got unexpected hr %#x.\n", hr); + IDirect3DRMFrame_Release(frame); IDirect3DRM_Release(d3drm); } -- 2.11.0
participants (1)
-
Henri Verbeet