Jeff Smith : d3drm: Validate that the transformation is affine in d3drm_frame3_AddTransform() .

Alexandre Julliard julliard at winehq.org
Thu Jun 20 16:04:17 CDT 2019


Module: wine
Branch: master
Commit: 530964855334131b2c02a9339fc4be44de72e950
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=530964855334131b2c02a9339fc4be44de72e950

Author: Jeff Smith <whydoubt at gmail.com>
Date:   Thu Jun 20 02:47:51 2019 +0430

d3drm: Validate that the transformation is affine in d3drm_frame3_AddTransform().

Signed-off-by: Jeff Smith <whydoubt at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 1e58926..c55d56a 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 bd10cc8..78a4388 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);
 }




More information about the wine-cvs mailing list