comparison 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
comparison
equal deleted inserted replaced
1415:89d124ac9bfa 1416:d794630429a7
1156 int xold = getXForFrame(oldPlayPointerFrame); 1156 int xold = getXForFrame(oldPlayPointerFrame);
1157 update(xold - 4, 0, 9, height()); 1157 update(xold - 4, 0, 9, height());
1158 1158
1159 sv_frame_t w = getEndFrame() - getStartFrame(); 1159 sv_frame_t w = getEndFrame() - getStartFrame();
1160 w -= w/5; 1160 w -= w/5;
1161 sv_frame_t sf = (m_playPointerFrame / w) * w - w/8; 1161 sv_frame_t sf = m_playPointerFrame;
1162 if (w > 0) {
1163 sf = (sf / w) * w - w/8;
1164 }
1162 1165
1163 if (m_manager && 1166 if (m_manager &&
1164 m_manager->isPlaying() && 1167 m_manager->isPlaying() &&
1165 m_manager->getPlaySelectionMode()) { 1168 m_manager->getPlaySelectionMode()) {
1166 MultiSelection::SelectionList selections = m_manager->getSelections(); 1169 MultiSelection::SelectionList selections = m_manager->getSelections();