mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 10:21:10 +02:00
user_menue: fix use heap after free, 2. try
This commit is contained in:
@@ -98,7 +98,7 @@ extern cVideo * videoDecoder;
|
||||
#if !HAVE_SPARK_HARDWARE
|
||||
extern CCAMMenuHandler * g_CamHandler;
|
||||
#endif
|
||||
|
||||
std::string CUserMenu::tmp;
|
||||
//
|
||||
#include <system/debug.h>
|
||||
|
||||
@@ -580,7 +580,6 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
||||
neutrino_locale_t loc = NONEXISTANT_LOCALE;
|
||||
const char *text = NULL;
|
||||
int mode = CNeutrinoApp::getInstance()->getMode();
|
||||
|
||||
std::vector<std::string> items = ::split(g_settings.usermenu[button]->items, ',');
|
||||
for (std::vector<std::string>::iterator it = items.begin(); it != items.end(); ++it) {
|
||||
int item = -1;
|
||||
@@ -595,7 +594,8 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
||||
int nop = g_Plugins->getNumberOfPlugins();
|
||||
for(int count = 0; count < nop; count++) {
|
||||
if (std::string(g_Plugins->getFileName(count)) == *it) {
|
||||
text = g_Plugins->getName(count);
|
||||
tmp = g_Plugins->getName(count);
|
||||
text = tmp.c_str();
|
||||
active = true;
|
||||
break;
|
||||
}
|
||||
@@ -608,7 +608,7 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
||||
if (mode == NeutrinoModes::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) {
|
||||
if(loc == NONEXISTANT_LOCALE && !text) {
|
||||
CWebTVResolution webtvres;
|
||||
std::string tmp = webtvres.getResolutionValue();
|
||||
tmp = webtvres.getResolutionValue();
|
||||
if (!(videoDecoder->getBlank()))
|
||||
{
|
||||
int xres = 0, yres = 0, framerate;
|
||||
@@ -655,11 +655,15 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
||||
continue;
|
||||
case SNeutrinoSettings::ITEM_AUDIO_SELECT:
|
||||
if(loc == NONEXISTANT_LOCALE && !text) {
|
||||
if (mode == NeutrinoModes::mode_webtv)
|
||||
text = CMoviePlayerGui::getInstance(true).CurrentAudioName().c_str(); // use instance_bg
|
||||
else if (!g_RemoteControl->current_PIDs.APIDs.empty())
|
||||
text = g_RemoteControl->current_PIDs.APIDs[
|
||||
if (mode == NeutrinoModes::mode_webtv){
|
||||
tmp = CMoviePlayerGui::getInstance(true).CurrentAudioName(); // use instance_bg.
|
||||
text = tmp.c_str();
|
||||
}
|
||||
else if (!g_RemoteControl->current_PIDs.APIDs.empty()){
|
||||
tmp = g_RemoteControl->current_PIDs.APIDs[
|
||||
g_RemoteControl->current_PIDs.PIDs.selected_apid].desc;
|
||||
text = tmp.c_str();
|
||||
}
|
||||
} else
|
||||
return_title = true;
|
||||
active = true;
|
||||
|
@@ -71,6 +71,7 @@ class CUserMenu : public CChangeObserver
|
||||
private:
|
||||
int width;
|
||||
bool changeNotify(const neutrino_locale_t OptionName, void *);
|
||||
static std::string tmp;
|
||||
|
||||
public:
|
||||
CUserMenu();
|
||||
|
Reference in New Issue
Block a user