Nikolay Sivov : comctl32/imagelist: Fail to create imagelist with zero or negative image dimensions.
Alexandre Julliard
julliard at winehq.org
Fri Aug 20 10:19:15 CDT 2010
Module: wine
Branch: master
Commit: d84cad6a0664b756dc346ab2afc82142563d155e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d84cad6a0664b756dc346ab2afc82142563d155e
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Thu Aug 19 10:20:11 2010 +0400
comctl32/imagelist: Fail to create imagelist with zero or negative image dimensions.
---
dlls/comctl32/imagelist.c | 2 ++
dlls/comctl32/tests/imagelist.c | 3 ---
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c
index 6fee577..2218d99 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 d4699bc..26c7e12 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;
More information about the wine-cvs
mailing list