From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> --- dlls/comctl32/imagelist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index 6650e3db04b..781643545fd 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -3664,7 +3664,9 @@ static HRESULT WINAPI ImageListImpl_Initialize(IImageList2 *iface, INT cx, INT c } /* Some applications mistakenly use a very large initial image count. Limit it to something reasonable */ - initial = min(initial, 256); + if (initial > USHRT_MAX) + WARN("Image count has been truncated\n"); + initial = min(initial, USHRT_MAX); himl->cx = cx; himl->cy = cy; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10469