[PATCH] d3dxof: Make sure the returned object pointer is null when there is no more object.
Christian Costa
titan.costa at gmail.com
Mon Feb 20 16:42:49 CST 2012
This fixes bugs 20333 and 27254.
---
dlls/d3dxof/d3dxof.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c
index 3294f92..2b0770f 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))
More information about the wine-patches
mailing list