From 87d7fe68e2ea6a8435238b4ce17dc27c1eaeb67d Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Sun, 16 Sep 2012 20:23:33 +0200 Subject: [PATCH] d3dxof: Checkout output pointer and set returned interface to NULL at the beginning. --- dlls/d3dxof/d3dxof.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c index 02ed5936745..d8aaf624481 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; }