mfplat: Zero-initialize the device manager object.

This fixes a crash for me when reallocating "handles", triggered by the mfplat tests.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-12-03 20:55:39 -06:00 committed by Alexandre Julliard
parent 636d398c7d
commit 1452e47f0a
1 changed files with 1 additions and 3 deletions

View File

@ -8911,14 +8911,12 @@ HRESULT WINAPI MFCreateDXGIDeviceManager(UINT *token, IMFDXGIDeviceManager **man
if (!token || !manager)
return E_POINTER;
object = heap_alloc(sizeof(*object));
if (!object)
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
object->IMFDXGIDeviceManager_iface.lpVtbl = &dxgi_device_manager_vtbl;
object->refcount = 1;
object->token = GetTickCount();
object->device = NULL;
InitializeCriticalSection(&object->cs);
InitializeConditionVariable(&object->lock);