comctl32/listbox: Check for out of bounds using the index when painting the item.

Needed for LBS_NODATA.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Gabriel Ivăncescu 2019-02-07 15:12:20 +02:00 committed by Alexandre Julliard
parent 1867b095a0
commit 98ece04660
1 changed files with 1 additions and 1 deletions

View File

@ -508,7 +508,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 );