Protect against programs creating parts with negative width.

This commit is contained in:
Gerard Patel 2000-06-20 20:13:24 +00:00 committed by Alexandre Julliard
parent 5890c09983
commit d837d9db63
1 changed files with 2 additions and 1 deletions

View File

@ -128,6 +128,8 @@ STATUSBAR_RefreshPart (HWND hwnd, STATUSWINDOWPART *part, HDC hdc, int itemID)
if (!IsWindowVisible (hwnd))
return;
if (part->bound.right < part->bound.left) return;
if (self->clrBk != CLR_DEFAULT)
hbrBk = CreateSolidBrush (self->clrBk);
else
@ -327,7 +329,6 @@ STATUSBAR_GetParts (HWND hwnd, WPARAM wParam, LPARAM lParam)
num_parts = (INT) wParam;
parts = (LPINT) lParam;
if (parts) {
return (infoPtr->numParts);
for (i = 0; i < num_parts; i++) {
parts[i] = infoPtr->parts[i].x;
}