diff --git a/reactos/dll/win32/uxtheme/draw.c b/reactos/dll/win32/uxtheme/draw.c index abc4153c1cf..d7081cc759e 100644 --- a/reactos/dll/win32/uxtheme/draw.c +++ b/reactos/dll/win32/uxtheme/draw.c @@ -241,6 +241,9 @@ static HRESULT UXTHEME_LoadImage(HTHEME hTheme, HDC hdc, int iPartId, int iState imagenum = max (min (imagecount, iStateId), 1) - 1; GetObjectW(*hBmp, sizeof(bmp), &bmp); + + if(imagecount < 1) imagecount = 1; + if(imagelayout == IL_VERTICAL) { int height = bmp.bmHeight/imagecount; bmpRect->left = 0;