Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

clamp offset to valid range in CGUIEpgGridContainer::ScrollToBlockOff…

…set(), fixes #13660
  • Loading branch information...
commit f884cfc96c5899da022b03ffcb60617cc14ee5f0 1 parent 8ce3f48
@pieh pieh authored
Showing with 4 additions and 10 deletions.
  1. +4 −10 xbmc/epg/GUIEPGGridContainer.cpp
View
14 xbmc/epg/GUIEPGGridContainer.cpp
@@ -901,16 +901,7 @@ void CGUIEPGGridContainer::ChannelScroll(int amount)
void CGUIEPGGridContainer::ProgrammesScroll(int amount)
{
// increase or decrease the horizontal offset
- int offset = m_blockOffset + amount;
-
- if (offset > m_blocks - m_blocksPerPage)
- {
- offset = m_blocks - m_blocksPerPage;
- }
-
- if (offset < 0) offset = 0;
-
- ScrollToBlockOffset(offset);
+ ScrollToBlockOffset(m_blockOffset + amount);
}
bool CGUIEPGGridContainer::MoveChannel(bool direction, bool wrapAround)
@@ -1471,6 +1462,9 @@ void CGUIEPGGridContainer::ScrollToChannelOffset(int offset)
void CGUIEPGGridContainer::ScrollToBlockOffset(int offset)
{
+ // make sure offset is in valid range
+ offset = std::max(0, std::min(offset, m_blocks - m_blocksPerPage));
+
float size = m_blockSize;
int range = m_blocksPerPage / 1;
Please sign in to comment.
Something went wrong with that request. Please try again.