diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index 6fee577edf7..2218d996e71 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -694,6 +694,8 @@ ImageList_Create (INT cx, INT cy, UINT flags, TRACE("(%d %d 0x%x %d %d)\n", cx, cy, flags, cInitial, cGrow); + if (cx <= 0 || cy <= 0) return NULL; + /* Create the IImageList interface for the image list */ if (FAILED(ImageListImpl_CreateInstance(NULL, &IID_IImageList, (void **)&himl))) return NULL; diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c index d4699bca589..26c7e12f184 100644 --- a/dlls/comctl32/tests/imagelist.c +++ b/dlls/comctl32/tests/imagelist.c @@ -1754,7 +1754,6 @@ static void test_create(void) { HIMAGELIST himl; -todo_wine { /* list with zero or negative image dimensions */ himl = ImageList_Create(0, 0, ILC_COLOR16, 0, 3); ok(himl == NULL, "got %p\n", himl); @@ -1772,8 +1771,6 @@ todo_wine { ok(himl == NULL, "got %p\n", himl); } -} - START_TEST(imagelist) { ULONG_PTR ctx_cookie;