Austin English : uxtheme: Fix a compiler warning.

Alexandre Julliard julliard at winehq.org
Tue Dec 9 06:24:52 CST 2008


Module: wine
Branch: master
Commit: 0f361b802d8f02fb9115b41860221f9c4e341ab6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0f361b802d8f02fb9115b41860221f9c4e341ab6

Author: Austin English <austinenglish at gmail.com>
Date:   Tue Dec  9 00:39:50 2008 -0600

uxtheme: Fix a compiler warning.

---

 dlls/uxtheme/msstyles.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c
index 1ca4d26..3f2a054 100644
--- a/dlls/uxtheme/msstyles.c
+++ b/dlls/uxtheme/msstyles.c
@@ -685,9 +685,9 @@ static BOOL parse_handle_color_property (struct PARSECOLORSTATE* state,
 {
     int r,g,b;
     LPCWSTR lpValueEnd = lpValue + dwValueLen;
-    MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &r);
-    MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &g);
-    if(MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &b)) {
+    if(MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &r) &&
+    MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &g) &&
+    MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &b)) {
 	state->colorElements[state->colorCount] = iPropertyId - TMT_FIRSTCOLOR;
 	state->colorRgb[state->colorCount++] = RGB(r,g,b);
 	switch (iPropertyId)
@@ -1210,8 +1210,14 @@ HRESULT MSSTYLES_GetPropertyColor(PTHEME_PROPERTY tp, COLORREF *pColor)
     lpCur = tp->lpValue;
     lpEnd = tp->lpValue + tp->dwValueLen;
 
-    MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &red);
-    MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &green);
+    if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &red)) {
+        TRACE("Could not parse color property\n");
+        return E_PROP_ID_UNSUPPORTED;
+    }
+    if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &green)) {
+        TRACE("Could not parse color property\n");
+        return E_PROP_ID_UNSUPPORTED;
+    }
     if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &blue)) {
         TRACE("Could not parse color property\n");
         return E_PROP_ID_UNSUPPORTED;
@@ -1316,7 +1322,10 @@ HRESULT MSSTYLES_GetPropertyPosition(PTHEME_PROPERTY tp, POINT *pPoint)
     LPCWSTR lpCur = tp->lpValue;
     LPCWSTR lpEnd = tp->lpValue + tp->dwValueLen;
 
-    MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &x);
+    if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &x)) {
+        TRACE("Could not parse position property\n");
+        return E_PROP_ID_UNSUPPORTED;
+    }
     if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &y)) {
         TRACE("Could not parse position property\n");
         return E_PROP_ID_UNSUPPORTED;




More information about the wine-cvs mailing list