Permalink
Browse files

Fixes null dereference

When watching a recording from liveTV group, player_ctx->recorder is null. There’s also no card id to record.

Fixes #12079
  • Loading branch information...
1 parent 2c71895 commit 103d573f292809a333c998f8397c951f84eedbfd @jyavenard jyavenard committed Mar 2, 2014
Showing with 8 additions and 5 deletions.
  1. +8 −5 mythtv/libs/libmythtv/mythplayer.cpp
@@ -1019,11 +1019,14 @@ int MythPlayer::OpenFile(uint retries)
{
gCoreContext->SaveSetting(
"DefaultChanid", player_ctx->playingInfo->GetChanID());
- int cardid = player_ctx->recorder->GetRecorderNumber();
- QString channum = player_ctx->playingInfo->GetChanNum();
- QString inputname;
- int cardinputid = CardUtil::GetCardInputID(cardid, channum, inputname);
- CardUtil::SetStartChannel(cardinputid, channum);
+ if (player_ctx->recorder && player_ctx->recorder->IsValidRecorder())
+ {
+ int cardid = player_ctx->recorder->GetRecorderNumber();
+ QString channum = player_ctx->playingInfo->GetChanNum();
+ QString inputname;
+ int cardinputid = CardUtil::GetCardInputID(cardid, channum, inputname);
+ CardUtil::SetStartChannel(cardinputid, channum);
+ }
}
return IsErrored() ? -1 : 0;

0 comments on commit 103d573

Please sign in to comment.