From 40b15a380d4bd4e7c771aad83e91a0a07f8d59dd Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Mon, 20 Feb 2012 23:42:49 +0100 Subject: [PATCH] d3dxof: Make sure the returned object pointer is null when there is no more object. --- dlls/d3dxof/d3dxof.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c index 3294f927398..2b0770f2002 100644 --- a/dlls/d3dxof/d3dxof.c +++ b/dlls/d3dxof/d3dxof.c @@ -988,17 +988,22 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE 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)) { + if (!parse_templates(&This->buf)) + { hr = DXFILEERR_BADVALUE; goto error; } if (!This->buf.rem_bytes) + { + *ppDataObj = NULL; return DXFILEERR_NOMOREOBJECTS; + } hr = IDirectXFileDataImpl_Create(&object); if (FAILED(hr)) -- 2.11.4.GIT