Commit 76707020 authored by Stephan BEUZE's avatar Stephan BEUZE Committed by Alexandre Julliard

- Avoid division by zero in TRACKBAR_GetTicPos

- Manage negative range TRACKBAR_DrawOneTic
parent 2123c137
......@@ -442,7 +442,7 @@ TRACKBAR_DrawOneTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
}
range = infoPtr->lRangeMax - infoPtr->lRangeMin;
if (range == 0)
if (range <= 0)
range = 1; /* to avoid division by zero */
if (flags & TIC_SELECTIONMARK) {
......@@ -966,6 +966,7 @@ TRACKBAR_GetTicPos (TRACKBAR_INFO *infoPtr, INT iTic)
tic = TRACKBAR_GetTic (infoPtr, iTic);
range = infoPtr->lRangeMax - infoPtr->lRangeMin;
if (range <= 0) range = 1;
width = infoPtr->rcChannel.right - infoPtr->rcChannel.left;
pos = infoPtr->rcChannel.left + (width * tic) / range;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment