From 530964855334131b2c02a9339fc4be44de72e950 Mon Sep 17 00:00:00 2001 From: Jeff Smith Date: Thu, 20 Jun 2019 02:29:51 +0430 Subject: [PATCH] d3drm: Validate that the transformation is affine in d3drm_frame3_AddTransform(). Signed-off-by: Jeff Smith Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- 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 1e58926dac1..c55d56a0854 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 bd10cc8727b..78a43884fe3 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); }