quartz: Return E_OUTOFMEMORY of the StdMemAllocator is unable to allocate memory.
authorAric Stewart <aric@codeweavers.com>
Fri, 17 Sep 2010 18:59:28 +0000 (13:59 -0500)
committerAlexandre Julliard <julliard@winehq.org>
Sat, 18 Sep 2010 11:09:20 +0000 (13:09 +0200)
dlls/quartz/memallocator.c

index a1c4473238fdad38f5bca1c65dc5cddd603faa0d..c0be482adf856e6652fb0a3a08076afd31a854c3 100644 (file)
@@ -802,6 +802,9 @@ static HRESULT StdMemAllocator_Alloc(IMemAllocator * iface)
     /* allocate memory */
     This->pMemory = VirtualAlloc(NULL, (This->base.props.cbBuffer + This->base.props.cbPrefix) * This->base.props.cBuffers, MEM_COMMIT, PAGE_READWRITE);
 
+    if (!This->pMemory)
+        return E_OUTOFMEMORY;
+
     for (i = This->base.props.cBuffers - 1; i >= 0; i--)
     {
         /* pbBuffer does not start at the base address, it starts at base + cbPrefix */