mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-25 21:41:04 +00:00
Merge branch 'fix_asan_error' into 'master'
Fix ASAN error: heap-use-after-free See merge request OpenMW/openmw!1495
This commit is contained in:
commit
476d8b7e86
@ -1,6 +1,7 @@
|
|||||||
#include "advancedpage.hpp"
|
#include "advancedpage.hpp"
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <components/config/gamesettings.hpp>
|
#include <components/config/gamesettings.hpp>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
@ -20,13 +21,13 @@ Launcher::AdvancedPage::AdvancedPage(Config::GameSettings &gameSettings, QWidget
|
|||||||
setObjectName ("AdvancedPage");
|
setObjectName ("AdvancedPage");
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
for(const char * name : Launcher::enumerateOpenALDevices())
|
for(const std::string& name : Launcher::enumerateOpenALDevices())
|
||||||
{
|
{
|
||||||
audioDeviceSelectorComboBox->addItem(QString::fromUtf8(name), QString::fromUtf8(name));
|
audioDeviceSelectorComboBox->addItem(QString::fromStdString(name), QString::fromStdString(name));
|
||||||
}
|
}
|
||||||
for(const char * name : Launcher::enumerateOpenALDevicesHrtf())
|
for(const std::string& name : Launcher::enumerateOpenALDevicesHrtf())
|
||||||
{
|
{
|
||||||
hrtfProfileSelectorComboBox->addItem(QString::fromUtf8(name), QString::fromUtf8(name));
|
hrtfProfileSelectorComboBox->addItem(QString::fromStdString(name), QString::fromStdString(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
#define ALC_ALL_DEVICES_SPECIFIER 0x1013
|
#define ALC_ALL_DEVICES_SPECIFIER 0x1013
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::vector<const char *> Launcher::enumerateOpenALDevices()
|
std::vector<std::string> Launcher::enumerateOpenALDevices()
|
||||||
{
|
{
|
||||||
std::vector<const char *> devlist;
|
std::vector<std::string> devlist;
|
||||||
const ALCchar *devnames;
|
const ALCchar *devnames;
|
||||||
|
|
||||||
if(alcIsExtensionPresent(nullptr, "ALC_ENUMERATE_ALL_EXT"))
|
if(alcIsExtensionPresent(nullptr, "ALC_ENUMERATE_ALL_EXT"))
|
||||||
@ -22,7 +22,7 @@ std::vector<const char *> Launcher::enumerateOpenALDevices()
|
|||||||
{
|
{
|
||||||
devnames = alcGetString(nullptr, ALC_DEVICE_SPECIFIER);
|
devnames = alcGetString(nullptr, ALC_DEVICE_SPECIFIER);
|
||||||
}
|
}
|
||||||
|
|
||||||
while(devnames && *devnames)
|
while(devnames && *devnames)
|
||||||
{
|
{
|
||||||
devlist.emplace_back(devnames);
|
devlist.emplace_back(devnames);
|
||||||
@ -31,9 +31,9 @@ std::vector<const char *> Launcher::enumerateOpenALDevices()
|
|||||||
return devlist;
|
return devlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<const char *> Launcher::enumerateOpenALDevicesHrtf()
|
std::vector<std::string> Launcher::enumerateOpenALDevicesHrtf()
|
||||||
{
|
{
|
||||||
std::vector<const char *> ret;
|
std::vector<std::string> ret;
|
||||||
|
|
||||||
ALCdevice *device = alcOpenDevice(nullptr);
|
ALCdevice *device = alcOpenDevice(nullptr);
|
||||||
if(device)
|
if(device)
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace Launcher
|
namespace Launcher
|
||||||
{
|
{
|
||||||
std::vector<const char *> enumerateOpenALDevices();
|
std::vector<std::string> enumerateOpenALDevices();
|
||||||
std::vector<const char *> enumerateOpenALDevicesHrtf();
|
std::vector<std::string> enumerateOpenALDevicesHrtf();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user