Permalink
Browse files

Fix Coverity 746812 and 1025905. Check ctx->player before dereferencing.

  • Loading branch information...
stichnot committed Jun 16, 2013
1 parent 1c8e30b commit 1d85b82c9b20605128c6e4719cc9ca8ce290aeff
Showing with 6 additions and 1 deletion.
  1. +6 −1 mythtv/libs/libmythtv/tv_play.cpp
@@ -5109,6 +5109,8 @@ void TV::ProcessNetworkControlCommand(PlayerContext *ctx,
{
if (tokens[2] == "POSITION")
{
if (!ctx->player)
return;
QString speedStr;
if (ContextIsPaused(ctx, __FILE__, __LINE__))
{
@@ -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")
@@ -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();

0 comments on commit 1d85b82

Please sign in to comment.