Commit 200f8921 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Fixed off by one allocation error (DPA and DSA).

parent 54d44d46
......@@ -843,7 +843,7 @@ DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
else {
/* resize the block of memory */
nNewItems =
hdsa->nGrow * ((INT)((nIndex - 1) / hdsa->nGrow) + 1);
hdsa->nGrow * ((INT)(((nIndex + 1) - 1) / hdsa->nGrow) + 1);
nSize = hdsa->nItemSize * nNewItems;
lpTemp = (LPVOID)COMCTL32_ReAlloc (hdsa->pData, nSize);
......@@ -1349,7 +1349,7 @@ DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p)
else {
/* resize the block of memory */
INT nNewItems =
hdpa->nGrow * ((INT)((i - 1) / hdpa->nGrow) + 1);
hdpa->nGrow * ((INT)(((i+1) - 1) / hdpa->nGrow) + 1);
INT nSize = nNewItems * sizeof(LPVOID);
lpTemp = (LPVOID*)HeapReAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY,
......
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