[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-patches
Subject:    [PATCH] uxtheme: assume imagecount to be 1 if unspecified
From:       Mark Harmstone <hellas () burntcomma ! com>
Date:       2015-02-28 20:22:27
Message-ID: 54F22383.60204 () burntcomma ! com
[Download RAW message or body]

This patch changes UXTHEME_LoadImage so that if the value of imagecount can't be
less than 1. If TMT_IMAGECOUNT is unspecified GetThemeInt will return 0, leading
to a divide by zero error a few lines later on.

---
 dlls/uxtheme/draw.c | 3 +++
 1 file changed, 3 insertions(+)



["0001-uxtheme-assume-imagecount-to-be-1-if-unspecified.patch" (text/x-patch)]

diff --git a/dlls/uxtheme/draw.c b/dlls/uxtheme/draw.c
index acb6d28..55feaa7 100644
--- a/dlls/uxtheme/draw.c
+++ b/dlls/uxtheme/draw.c
@@ -257,6 +257,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;





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic