mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 18:53:28 +01:00
Extra check when opening pup file
This commit is contained in:
parent
7180c1f2d0
commit
986bb24326
@ -1,9 +1,15 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "PUP.h"
|
||||
|
||||
pup_object::pup_object(const fs::file& file): m_file(file)
|
||||
{
|
||||
if (!file)
|
||||
{
|
||||
isValid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
PUPHeader m_header;
|
||||
m_file.read(m_header);
|
||||
if (m_header.magic != "SCEUF\0\0\0"_u64)
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMenuBar>
|
||||
#include <QMessageBox>
|
||||
@ -532,6 +532,13 @@ void main_window::InstallPup(const QString& dropPath)
|
||||
const std::string path = sstr(filePath);
|
||||
|
||||
fs::file pup_f(path);
|
||||
if (!pup_f)
|
||||
{
|
||||
LOG_ERROR(GENERAL, "Error opening PUP file %s", path);
|
||||
QMessageBox::critical(this, tr("Failure!"), tr("The selected firmware file couldn't be opened."));
|
||||
return;
|
||||
}
|
||||
|
||||
pup_object pup(pup_f);
|
||||
if (!pup)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user