Commit 1fc5160c authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

dinput: Fix dereference pointer after NULL check (Coverity).

parent 6239bf6f
......@@ -955,7 +955,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(
DWORD dwHow)
{
IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface;
DWORD dwSize = pdidoi->dwSize;
DWORD dwSize;
LPDIOBJECTDATAFORMAT odf;
int idx = -1;
......@@ -990,6 +990,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(
if (idx < 0) return DIERR_OBJECTNOTFOUND;
odf = dataformat_to_odf(This->data_format.wine_df, idx);
dwSize = pdidoi->dwSize; /* save due to memset below */
memset(pdidoi, 0, pdidoi->dwSize);
pdidoi->dwSize = dwSize;
if (odf->pguid) pdidoi->guidType = *odf->pguid;
......
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