Permalink
Browse files

epg: don't deref a null ptr in CGUIEPGGridContainer::GetSelectedItem()

  • Loading branch information...
1 parent 5c627d1 commit f3f2f22e9c24bd6f5626fa80c5ed728577b66b51 @opdenkamp committed Jul 8, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 xbmc/epg/GUIEPGGridContainer.cpp
@@ -1307,7 +1307,10 @@ bool CGUIEPGGridContainer::OnMouseWheel(char wheel, const CPoint &point)
int CGUIEPGGridContainer::GetSelectedItem() const
{
- if (!m_gridIndex || !m_epgItemsPtr.size())
+ if (!m_gridIndex ||
+ !m_epgItemsPtr.size() ||
+ m_channelCursor + m_channelCursor >= (int)m_channelItems.size() ||
+ m_blockCursor + m_blockOffset >= (int)m_programmeItems.size())
return 0;
CGUIListItemPtr currentItem = m_gridIndex[m_channelCursor + m_channelOffset][m_blockCursor + m_blockOffset].item;

0 comments on commit f3f2f22

Please sign in to comment.