[PATCH v2 2/6] d3drm: Frame AddTransform expects last column to contain [0 0 0 1]

Jeff Smith whydoubt at gmail.com
Mon Jun 17 20:21:00 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 46b5f37412..ed1e6c719f 100644
--- a/dlls/d3drm/frame.c
+++ b/dlls/d3drm/frame.c
@@ -965,6 +965,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 9cfdba484e..e91b1ddee6 100644
--- a/dlls/d3drm/tests/d3drm.c
+++ b/dlls/d3drm/tests/d3drm.c
@@ -2790,6 +2790,10 @@ static void test_frame_transform(void)
     IDirect3DRMFrame_GetTransform(frame, matrix);
     check_matrix(matrix, 2,0,0, 0,2,0, 0,0,2, 3,3,3, 32);
 
+    add_matrix[3][3] = 2.0f;
+    hr = IDirect3DRMFrame_AddTransform(frame, D3DRMCOMBINE_REPLACE, add_matrix);
+    ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %x.\n", hr);
+
 
     IDirect3DRMFrame_Release(frame);
     IDirect3DRM_Release(d3drm);
-- 
2.14.3




More information about the wine-devel mailing list