Commit 254e7484 authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard

DPAs can't have more than 0x8000 elements (fixed with lots of help

from Carlos <clozano@andago.com).
parent c7fbc1b2
......@@ -1879,6 +1879,9 @@ DPA_InsertPtr (const HDPA hdpa, INT i, LPVOID p)
if (!hdpa || i < 0) return -1;
if (i == 0x7fff)
i = hdpa->nItemCount;
if (i >= hdpa->nItemCount)
return DPA_SetPtr(hdpa, i, p) ? i : -1;
......@@ -1911,7 +1914,7 @@ DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p)
TRACE("(%p %d %p)\n", hdpa, i, p);
if ((!hdpa) || i < 0)
if (!hdpa || i < 0 || i > 0x7fff)
return FALSE;
if (hdpa->nItemCount <= i) {
......
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