comctl32: Fix possible use of uninitialised variable in REBAR_Paint.
In the case where an hdc is passed in via the wParam, ps.fErase could be uninitialised. Fix this by rearranging the code so that ps is only used when an hdc isn't passed in.
This commit is contained in:
parent
4e0100ff06
commit
f3c40f925d
|
@ -3197,24 +3197,23 @@ REBAR_NotifyFormat (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
static LRESULT
|
static LRESULT
|
||||||
REBAR_Paint (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
REBAR_Paint (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
HDC hdc;
|
HDC hdc = (HDC)wParam;
|
||||||
PAINTSTRUCT ps;
|
|
||||||
RECT rc;
|
|
||||||
|
|
||||||
GetClientRect(infoPtr->hwndSelf, &rc);
|
if (hdc) {
|
||||||
hdc = wParam==0 ? BeginPaint (infoPtr->hwndSelf, &ps) : (HDC)wParam;
|
TRACE("painting\n");
|
||||||
|
REBAR_Refresh (infoPtr, hdc);
|
||||||
TRACE("painting (%s) client (%s)\n",
|
} else {
|
||||||
wine_dbgstr_rect(&ps.rcPaint), wine_dbgstr_rect(&rc));
|
PAINTSTRUCT ps;
|
||||||
|
hdc = BeginPaint (infoPtr->hwndSelf, &ps);
|
||||||
if (ps.fErase) {
|
TRACE("painting (%s)\n", wine_dbgstr_rect(&ps.rcPaint));
|
||||||
/* Erase area of paint if requested */
|
if (ps.fErase) {
|
||||||
REBAR_InternalEraseBkGnd (infoPtr, wParam, lParam, &ps.rcPaint);
|
/* Erase area of paint if requested */
|
||||||
|
REBAR_InternalEraseBkGnd (infoPtr, wParam, lParam, &ps.rcPaint);
|
||||||
|
}
|
||||||
|
REBAR_Refresh (infoPtr, hdc);
|
||||||
|
EndPaint (infoPtr->hwndSelf, &ps);
|
||||||
}
|
}
|
||||||
|
|
||||||
REBAR_Refresh (infoPtr, hdc);
|
|
||||||
if (!wParam)
|
|
||||||
EndPaint (infoPtr->hwndSelf, &ps);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue