Christian Costa : d3dxof: Checkout output pointer and set returned interface to NULL at the beginning .

Alexandre Julliard julliard at winehq.org
Mon Sep 17 14:06:32 CDT 2012


Module: wine
Branch: master
Commit: 87d7fe68e2ea6a8435238b4ce17dc27c1eaeb67d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=87d7fe68e2ea6a8435238b4ce17dc27c1eaeb67d

Author: Christian Costa <titan.costa at gmail.com>
Date:   Sun Sep 16 20:23:33 2012 +0200

d3dxof: Checkout output pointer and set returned interface to NULL at the beginning.

---

 dlls/d3dxof/d3dxof.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c
index 02ed593..d8aaf62 100644
--- a/dlls/d3dxof/d3dxof.c
+++ b/dlls/d3dxof/d3dxof.c
@@ -987,27 +987,25 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
   IDirectXFileDataImpl* object;
   HRESULT hr;
 
+  if (!ppDataObj)
+    return E_POINTER;
+
+  *ppDataObj = NULL;
+
   TRACE("(%p/%p)->(%p)\n", This, iface, ppDataObj);
 
   if (This->nb_xobjects >= MAX_OBJECTS)
   {
     ERR("Too many objects\n");
-    *ppDataObj = NULL;
     return DXFILEERR_NOMOREOBJECTS;
   }
 
   /* Check if there are templates defined before the object */
   if (!parse_templates(&This->buf))
-  {
-    *ppDataObj = NULL;
     return DXFILEERR_BADVALUE;
-  }
 
   if (!This->buf.rem_bytes)
-  {
-    *ppDataObj = NULL;
     return DXFILEERR_NOMOREOBJECTS;
-  }
 
   hr = IDirectXFileDataImpl_Create(&object);
   if (FAILED(hr))
@@ -1064,7 +1062,6 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
 error:
 
   IDirectXFileData_Release(&object->IDirectXFileData_iface);
-  *ppDataObj = NULL;
 
   return hr;
 }




More information about the wine-cvs mailing list