Commit 7371d0d2 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/listview: Exit early on LVM_CREATEDRAGIMAGE if null pointer passed for a point.

parent 1b67da35
......@@ -5209,7 +5209,7 @@ static HIMAGELIST LISTVIEW_CreateDragImage(LISTVIEW_INFO *infoPtr, INT iItem, LP
HIMAGELIST dragList = 0;
TRACE("iItem=%d Count=%d\n", iItem, infoPtr->nItemCount);
if (iItem < 0 || iItem >= infoPtr->nItemCount)
if (iItem < 0 || iItem >= infoPtr->nItemCount || !lppt)
return 0;
rcItem.left = LVIR_BOUNDS;
......
......@@ -4344,6 +4344,28 @@ static void test_header_notification(void)
DestroyWindow(list);
}
static void test_createdragimage(void)
{
HIMAGELIST himl;
POINT pt;
HWND list;
list = create_listview_control(LVS_ICON);
ok(list != 0, "failed to create listview window\n");
insert_item(list, 0);
/* NULL point */
himl = (HIMAGELIST)SendMessageA(list, LVM_CREATEDRAGIMAGE, 0, 0);
ok(himl == NULL, "got %p\n", himl);
himl = (HIMAGELIST)SendMessageA(list, LVM_CREATEDRAGIMAGE, 0, (LPARAM)&pt);
ok(himl != NULL, "got %p\n", himl);
ImageList_Destroy(himl);
DestroyWindow(list);
}
START_TEST(listview)
{
HMODULE hComctl32;
......@@ -4406,6 +4428,7 @@ START_TEST(listview)
test_finditem();
test_hover();
test_destroynotify();
test_createdragimage();
if (!load_v6_module(&ctx_cookie, &hCtx))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment