Mercurial > hg > svgui
diff view/View.cpp @ 1416:d794630429a7
Fix potential divide-by-zero
author | Chris Cannam |
---|---|
date | Mon, 21 Jan 2019 10:08:26 +0000 |
parents | b0eeec95ab5b |
children | 2487521e857b |
line wrap: on
line diff
--- a/view/View.cpp Mon Jan 21 10:07:36 2019 +0000 +++ b/view/View.cpp Mon Jan 21 10:08:26 2019 +0000 @@ -1158,7 +1158,10 @@ sv_frame_t w = getEndFrame() - getStartFrame(); w -= w/5; - sv_frame_t sf = (m_playPointerFrame / w) * w - w/8; + sv_frame_t sf = m_playPointerFrame; + if (w > 0) { + sf = (sf / w) * w - w/8; + } if (m_manager && m_manager->isPlaying() &&