=?UTF-8?Q?Gabriel=20Iv=C4=83ncescu=20?=: comctl32/listbox: Account for NULL item when painting ownerdrawn list.

Alexandre Julliard julliard at winehq.org
Fri Nov 23 14:18:02 CST 2018


Module: wine
Branch: master
Commit: 79bb84d20d042e5259215136f967d97275334aba
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=79bb84d20d042e5259215136f967d97275334aba

Author: Gabriel Iv─âncescu <gabrielopcode at gmail.com>
Date:   Fri Nov 23 10:16:15 2018 +0300

comctl32/listbox: Account for NULL item when painting ownerdrawn list.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/listbox.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c
index 71a9c18..7525e7f 100644
--- a/dlls/comctl32/listbox.c
+++ b/dlls/comctl32/listbox.c
@@ -535,10 +535,10 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect,
         if (focused)
             dis.itemState |= ODS_FOCUS;
         if (!IsWindowEnabled(descr->self)) dis.itemState |= ODS_DISABLED;
-        dis.itemData     = item->data;
+        dis.itemData     = item ? item->data : 0;
         dis.rcItem       = *rect;
         TRACE("[%p]: drawitem %d (%s) action=%02x state=%02x rect=%s\n",
-              descr->self, index, debugstr_w(item->str), action,
+              descr->self, index, item ? debugstr_w(item->str) : "", action,
               dis.itemState, wine_dbgstr_rect(rect) );
         SendMessageW(descr->owner, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis);
         SelectClipRgn( hdc, hrgn );




More information about the wine-cvs mailing list