Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 103d573f292809a333c998f8397c951f84eedbfd 1 parent 2c71895
Jean-Yves Avenard jyavenard authored
Showing with 8 additions and 5 deletions.
  1. +8 −5 mythtv/libs/libmythtv/mythplayer.cpp
13 mythtv/libs/libmythtv/mythplayer.cpp
View
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.