Permalink
Browse files

Fix segfault in manual record when there are no recordable channels d…

…efined.
  • Loading branch information...
1 parent e8aef6a commit 875143ea35655452507ab6b30262be0636791f50 @daniel-kristjansson daniel-kristjansson committed May 24, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 mythtv/programs/mythfrontend/manualschedule.cpp
@@ -200,6 +200,12 @@ void ManualSchedule::recordClicked(void)
QDateTime endts = m_startDateTime
.addSecs(max(m_durationSpin->GetIntValue() * 60, 60));
+ if (m_channelList->GetCurrentPos() >= m_chanids.size())
+ {
+ LOG(VB_GENERAL, LOG_ERR, "Channel out of range.");
+ return; // this can happen if there are no channels..
+ }
+
ProgramInfo p(m_titleEdit->GetText().trimmed(),
m_chanids[m_channelList->GetCurrentPos()],
m_startDateTime, endts);

0 comments on commit 875143e

Please sign in to comment.