[PATCH 04/12] d3drm: Frame AddTransform expects last column to contain [0 0 0 1]
Jeff Smith
whydoubt at gmail.com
Thu Jun 13 23:27:29 CDT 2019
Signed-off-by: Jeff Smith <whydoubt at gmail.com>
---
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 545010caec..5df85e4fe2 100644
--- a/dlls/d3drm/frame.c
+++ b/dlls/d3drm/frame.c
@@ -980,6 +980,9 @@ static HRESULT WINAPI d3drm_frame3_AddTransform(IDirect3DRMFrame3 *iface,
TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
+ if (matrix[0][3] != 0.0f || matrix[1][3] != 0.0f || matrix[2][3] != 0.0f || matrix[3][3] != 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 51099dc58a..e9e789823c 100644
--- a/dlls/d3drm/tests/d3drm.c
+++ b/dlls/d3drm/tests/d3drm.c
@@ -2852,6 +2852,10 @@ static void test_frame_transform(void)
hr = IDirect3DRMFrame_AddTransform(frame, D3DRMCOMBINE_AFTER, matrix);
EXPECT_TRANSFORM("AddTransform (AFTER)", frame, 2,0,0, 0,2,0, 0,0,2, 3,3,3);
+ matrix[3][3] = 2.0f;
+ hr = IDirect3DRMFrame_AddTransform(frame, D3DRMCOMBINE_REPLACE, matrix);
+ ok(hr == D3DRMERR_BADVALUE, "AddTransform: BADVALUE error expected when last column != [0 0 0 1]\n");
+
IDirect3DRMFrame_Release(subframe);
IDirect3DRMFrame_Release(frame);
--
2.14.3
More information about the wine-devel
mailing list