aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Op den Kamp <opdenkamp@gmail.com>2013-08-23 03:22:41 -0700
committerLars Op den Kamp <opdenkamp@gmail.com>2013-08-23 03:22:41 -0700
commit88469746cdd3f384e9a3b1272bf492d3d15f6f09 (patch)
tree31d28fa91819057767d319a84d4cb6f3a5528cef
parent4bf0a356b565ff9faafa506711de042b29d7e177 (diff)
parentc87de614b4ce4a70098393a0e2d15b19683228fe (diff)
Merge pull request #3125 from janbar/noepg_timeline_crash
epg timeline: Fix crash when no epg
-rw-r--r--xbmc/epg/GUIEPGGridContainer.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/xbmc/epg/GUIEPGGridContainer.cpp b/xbmc/epg/GUIEPGGridContainer.cpp
index e4e4cfc08a..39266d9c46 100644
--- a/xbmc/epg/GUIEPGGridContainer.cpp
+++ b/xbmc/epg/GUIEPGGridContainer.cpp
@@ -1313,8 +1313,14 @@ bool CGUIEPGGridContainer::SelectItemFromPoint(const CPoint &point, bool justGri
if (block > m_blocksPerPage) block = m_blocksPerPage - 1;
if (block < 0) block = 0;
+ int channelIndex = channel + m_channelOffset;
+ int blockIndex = block + m_blockOffset;
+
+ // bail if out of range
+ if (channelIndex >= m_channels || blockIndex > MAXBLOCKS)
+ return false;
// bail if block isn't occupied
- if (!m_gridIndex[channel + m_channelOffset][block + m_blockOffset].item)
+ if (!m_gridIndex[channelIndex][blockIndex].item)
return false;
SetChannel(channel);