diff --git a/include/wx/univ/renderer.h b/include/wx/univ/renderer.h index c0f8e947fd..f6fe94b515 100644 --- a/include/wx/univ/renderer.h +++ b/include/wx/univ/renderer.h @@ -655,7 +655,7 @@ public: int step = 1, int flags = 0) { m_renderer->DrawSliderTicks(dc, rect, sizeThumb, orient, - start, end, start, flags); } + start, end, step, flags); } virtual void DrawMenuBarItem(wxDC& dc, const wxRect& rect, diff --git a/src/univ/themes/win32.cpp b/src/univ/themes/win32.cpp index ccf87bc3ff..d3afd47d7c 100644 --- a/src/univ/themes/win32.cpp +++ b/src/univ/themes/win32.cpp @@ -2771,6 +2771,9 @@ void wxWin32Renderer::DrawSliderTicks(wxDC& dc, return; } + // this would lead to an infinite loop below + wxCHECK_RET( step > 1, _T("invalid step in wxRenderer::DrawSliderTicks") ); + // the variable names correspond to horizontal case, but they can be used // for both orientations wxCoord x1, x2, y1, y2, len, widthThumb;