Skip to content

Commit

Permalink
fixup! possible invalid value of preset index
Browse files Browse the repository at this point in the history
  • Loading branch information
afedchin committed Dec 25, 2017
1 parent e19eb34 commit 45088c3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/MilkdropXBMC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ void SetPresetDir(const char *pack)
if (g_plugin->m_pPresetAddr)
{
g_plugin->m_bHoldPreset = lastLockedStatus;
if (lastPresetIndx < 0 || lastPresetIndx >(g_plugin->m_nPresets - g_plugin->m_nDirs))
lastPresetIndx = 0;
g_plugin->m_nCurrentPreset = lastPresetIndx;
strcpy(g_plugin->m_szCurrentPresetFile, g_plugin->m_szPresetDir);
strcat(g_plugin->m_szCurrentPresetFile, g_plugin->m_pPresetAddr[g_plugin->m_nCurrentPreset]);
Expand Down

0 comments on commit 45088c3

Please sign in to comment.