d3drm: Pass the correct pointer to IDirectXFileData_GetData (PVS-Studio)

Michael Stefaniuc mstefani at redhat.de
Thu Oct 30 05:24:20 CDT 2014


Also remove an uneeded initialization of "size" as that is purely an
[OUT] parameter.
---
d3dxof/tests/d3dxof.c has tests that show that "size" is purely [OUT]


 dlls/d3drm/d3drm.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/d3drm/d3drm.c b/dlls/d3drm/d3drm.c
index 06850bc..92ac272 100644
--- a/dlls/d3drm/d3drm.c
+++ b/dlls/d3drm/d3drm.c
@@ -1240,17 +1240,16 @@ static HRESULT load_data(IDirect3DRM3 *iface, IDirectXFileData *data_object, IID
         /* Cannot be requested */
         if (parent_frame)
         {
-            D3DRMMATRIX4D matrix;
+            D3DRMMATRIX4D *matrix;
             DWORD size;
 
             TRACE("Load Frame Transform Matrix data\n");
 
-            size = sizeof(matrix);
-            hr = IDirectXFileData_GetData(data_object, NULL, &size, (void**)matrix);
+            hr = IDirectXFileData_GetData(data_object, NULL, &size, (void**)&matrix);
             if ((hr != DXFILE_OK) || (size != sizeof(matrix)))
                 goto end;
 
-            hr = IDirect3DRMFrame3_AddTransform(parent_frame, D3DRMCOMBINE_REPLACE, matrix);
+            hr = IDirect3DRMFrame3_AddTransform(parent_frame, D3DRMCOMBINE_REPLACE, *matrix);
             if (FAILED(hr))
                 goto end;
         }
-- 
1.9.3



More information about the wine-patches mailing list