Commit 310c174e authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

d3dxof: Make sure This->buf.pdata is set to NULL before being used in case of error.

parent d3fb5860
...@@ -963,6 +963,9 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE ...@@ -963,6 +963,9 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
This->buf.pxo_globals = This->xobjects; This->buf.pxo_globals = This->xobjects;
This->buf.nb_pxo_globals = This->nb_xobjects; This->buf.nb_pxo_globals = This->nb_xobjects;
This->buf.level = 0; This->buf.level = 0;
This->buf.pdata = NULL;
This->buf.capacity = 0;
This->buf.cur_pos_data = 0;
This->buf.pxo_tab = HeapAlloc(GetProcessHeap(), 0, sizeof(xobject)*MAX_SUBOBJECTS); This->buf.pxo_tab = HeapAlloc(GetProcessHeap(), 0, sizeof(xobject)*MAX_SUBOBJECTS);
if (!This->buf.pxo_tab) if (!This->buf.pxo_tab)
...@@ -973,9 +976,7 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE ...@@ -973,9 +976,7 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
} }
This->buf.pxo = This->xobjects[This->nb_xobjects] = This->buf.pxo_tab; This->buf.pxo = This->xobjects[This->nb_xobjects] = This->buf.pxo_tab;
This->buf.pxo->pdata = This->buf.pdata = NULL; This->buf.pxo->pdata = NULL;
This->buf.capacity = 0;
This->buf.cur_pos_data = 0;
This->buf.pxo->nb_subobjects = 1; This->buf.pxo->nb_subobjects = 1;
pstrings = HeapAlloc(GetProcessHeap(), 0, MAX_STRINGS_BUFFER); pstrings = HeapAlloc(GetProcessHeap(), 0, MAX_STRINGS_BUFFER);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment