comctl32/imagelist: Fix crash with large number of images.
Fix a crash that occurred when reading a imagelist with a large number of images. In the particular case we read a cMaxImage value of 1032, but allocated only 40 or so images. This lead to memory corruption in ImageList_Read. This change allows to run TntConnect. Signed-off-by: Eberhard Beilharz <eb1@sil.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
64addb512b
commit
f760079a71
|
@ -2273,7 +2273,7 @@ HIMAGELIST WINAPI ImageList_Read(IStream *pstm)
|
|||
TRACE("cx %u, cy %u, flags 0x%04x, cCurImage %u, cMaxImage %u\n",
|
||||
ilHead.cx, ilHead.cy, ilHead.flags, ilHead.cCurImage, ilHead.cMaxImage);
|
||||
|
||||
himl = ImageList_Create(ilHead.cx, ilHead.cy, ilHead.flags, ilHead.cCurImage, ilHead.cMaxImage);
|
||||
himl = ImageList_Create(ilHead.cx, ilHead.cy, ilHead.flags, ilHead.cMaxImage, ilHead.cGrow);
|
||||
if (!himl)
|
||||
return NULL;
|
||||
|
||||
|
|
Loading…
Reference in New Issue