[PATCH v2 0/1] MR10469: comctl32/imagelist: Allow for larger initial image count.
I have an application that uses 970+ as an valid initial value, and causes random crashes when restricted to 256. -- v2: comctl32/imagelist: Allow for larger initial image count. https://gitlab.winehq.org/wine/wine/-/merge_requests/10469
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
This merge request was approved by Zhiyi Zhang. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10469
Thanks for fixing this! -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10469#note_134249
participants (3)
-
Alistair Leslie-Hughes -
Alistair Leslie-Hughes (@alesliehughes) -
Zhiyi Zhang (@zhiyi)