Skip to content

Commit

Permalink
Merge pull request xbmc#6990 from xhaggi/builtin-fix-nullpointer
Browse files Browse the repository at this point in the history
[builtins] fix bad access if GetWindow() is called with virtual window id
  • Loading branch information
xhaggi committed Apr 20, 2015
2 parents 8351b02 + fa12f18 commit e1da274
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 8 additions & 0 deletions xbmc/guilib/GUIWindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,14 @@ void CGUIWindowManager::ActivateWindow_Internal(int iWindowID, const vector<stri
return;
}

// don't activate a window if there are active modal dialogs
if (HasModalDialog())
{
CLog::Log(LOG_LEVEL_DEBUG, "Activate of window '%i' refused because there are active modal dialogs", iWindowID);
g_audioManager.PlayActionSound(CAction(ACTION_ERROR));
return;
}

g_infoManager.SetNextWindow(iWindowID);

// set our overlay state
Expand Down
8 changes: 0 additions & 8 deletions xbmc/interfaces/Builtins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,6 @@ void CBuiltins::GetHelp(std::string &help)

bool CBuiltins::ActivateWindow(int iWindowID, const std::vector<std::string>& params /* = {} */, bool swappingWindows /* = false */)
{
// don't activate a window if there are active modal dialogs
if (g_windowManager.HasModalDialog() && !g_windowManager.GetWindow(iWindowID)->IsDialog())
{
CLog::Log(LOG_LEVEL_DEBUG, "Activate of window '%i' refused because there are active modal dialogs", iWindowID);
g_audioManager.PlayActionSound(CAction(ACTION_ERROR));
return false;
}

// disable the screensaver
g_application.WakeUpScreenSaverAndDPMS();
g_windowManager.ActivateWindow(iWindowID, params, swappingWindows);
Expand Down

0 comments on commit e1da274

Please sign in to comment.