Skip to content

Commit

Permalink
Fix Coverity 746812 and 1025905. Check ctx->player before dereferencing.
Browse files Browse the repository at this point in the history
  • Loading branch information
stichnot committed Jun 16, 2013
1 parent 1c8e30b commit 1d85b82
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -5109,6 +5109,8 @@ void TV::ProcessNetworkControlCommand(PlayerContext *ctx,
{
if (tokens[2] == "POSITION")
{
if (!ctx->player)
return;
QString speedStr;
if (ContextIsPaused(ctx, __FILE__, __LINE__))
{
Expand Down Expand Up @@ -5301,6 +5303,8 @@ void TV::ProcessNetworkControlCommand(PlayerContext *ctx,
}
else if (tokens[2] == "VOLUME")
{
if (!ctx->player)
return;
QString infoStr = QString("%1%").arg(ctx->player->GetVolume());

QString message = QString("NETWORK_CONTROL ANSWER %1")
Expand Down Expand Up @@ -7010,7 +7014,8 @@ void TV::SwitchCards(PlayerContext *ctx,
// pause the decoder first, so we're not reading too close to the end.
ctx->buffer->IgnoreLiveEOF(true);
ctx->buffer->StopReads();
ctx->player->PauseDecoder();
if (ctx->player)
ctx->player->PauseDecoder();

// shutdown stuff
ctx->buffer->Pause();
Expand Down

0 comments on commit 1d85b82

Please sign in to comment.