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:
Eberhard Beilharz 2018-12-11 21:00:23 +01:00 committed by Alexandre Julliard
parent 64addb512b
commit f760079a71
1 changed files with 1 additions and 1 deletions

View File

@ -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;