diff --git a/dlls/rpcrt4/ndr_fullpointer.c b/dlls/rpcrt4/ndr_fullpointer.c index f4485b22b7b..b89b66902f8 100644 --- a/dlls/rpcrt4/ndr_fullpointer.c +++ b/dlls/rpcrt4/ndr_fullpointer.c @@ -32,11 +32,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(rpc); PFULL_PTR_XLAT_TABLES WINAPI NdrFullPointerXlatInit(unsigned long NumberOfPointers, XLAT_SIDE XlatSide) { - unsigned long NumberOfBuckets = ((NumberOfPointers + 3) & 4) - 1; + unsigned long NumberOfBuckets; PFULL_PTR_XLAT_TABLES pXlatTables = HeapAlloc(GetProcessHeap(), 0, sizeof(*pXlatTables)); TRACE("(%ld, %d)\n", NumberOfPointers, XlatSide); + if (!NumberOfPointers) NumberOfPointers = 512; + NumberOfBuckets = ((NumberOfPointers + 3) & ~3) - 1; + pXlatTables->RefIdToPointer.XlatTable = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(void *) * NumberOfPointers);