diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 4d1e9ccc6..cb97df43e 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1793,7 +1793,10 @@ void CAudioPlayerGui::paint() { if (m_show_playlist) { - m_liststart = (m_selected / m_listmaxshow) * m_listmaxshow; + unsigned int tmp_max = m_listmaxshow; + if(!tmp_max) + tmp_max = 1; + m_liststart = (m_selected / tmp_max) * m_listmaxshow; paintHead(); for (unsigned int count=0; countpaintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - int sbc = ((m_playlist.size() - 1) / m_listmaxshow) + 1; - int sbs = (m_selected / m_listmaxshow); + int sbc = ((m_playlist.size() - 1) / tmp_max) + 1; + int sbs = (m_selected / tmp_max); if (sbc < 1) sbc = 1; diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 40e5c3b28..9adbf5555 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -761,8 +761,11 @@ void CPictureViewerGui::paint() int sb = fheight* listmaxshow; frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - int sbc= ((playlist.size()- 1)/ listmaxshow)+ 1; - int sbs= (selected/listmaxshow); + unsigned int tmp_max = listmaxshow; + if(!tmp_max) + tmp_max = 1; + int sbc= ((playlist.size()- 1)/ tmp_max)+ 1; + int sbs= (selected/tmp_max); if (sbc < 1) sbc = 1; diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 649b22860..5baa6df67 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -965,9 +965,11 @@ void CUpnpBrowserGui::paintDevices() ypos = m_y + m_title_height + m_theight; int sb = m_fheight * m_listmaxshow; m_frameBuffer->paintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - - int sbc = ((m_devices.size() - 1) / m_listmaxshow) + 1; - int sbs = ((m_selecteddevice) / m_listmaxshow); + unsigned int tmp_max = m_listmaxshow; + if(!tmp_max) + tmp_max = 1; + int sbc = ((m_devices.size() - 1) / tmp_max) + 1; + int sbs = ((m_selecteddevice) / tmp_max); m_frameBuffer->paintBoxRel(m_x + m_width - 13, ypos + 2 + sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3);