[PATCH 1/5] user32/listbox: Check for out of bounds using the index when painting the item

Gabriel Iv─âncescu gabrielopcode at gmail.com
Fri Feb 8 05:17:18 CST 2019


Needed for LBS_NODATA.

Signed-off-by: Gabriel Iv─âncescu <gabrielopcode at gmail.com>
---

user32 versions of the comctl32 patchset.

 dlls/user32/listbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c
index 594c956..821da60 100644
--- a/dlls/user32/listbox.c
+++ b/dlls/user32/listbox.c
@@ -533,7 +533,7 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect,
         RECT r;
         HRGN hrgn;
 
-	if (!item)
+	if (index >= descr->nb_items)
 	{
 	    if (action == ODA_FOCUS)
 		DrawFocusRect( hdc, rect );
-- 
2.19.1




More information about the wine-devel mailing list