ROMManager: initialise filedata to nullptr
If a user manages to open a file as a ROM that is greater than 1 GiB, it will cause a segmentation fault (a crash) in LoadROM due to a delete being called on an uninitialised pointer, which is undefined behaviour. Initialise filedata to nullptr to prevent this, as deleting a null pointer is defined as a no-op.
This commit is contained in:
parent
df571078cf
commit
0e4d082361
|
@ -1109,7 +1109,7 @@ bool LoadROM(QStringList filepath, bool reset)
|
|||
{
|
||||
if (filepath.empty()) return false;
|
||||
|
||||
u8* filedata;
|
||||
u8* filedata = nullptr;
|
||||
u32 filelen;
|
||||
|
||||
std::string basepath;
|
||||
|
|
Loading…
Reference in New Issue