cellSaveData/overlays/Qt: fix some warnings and a possible nullptr deref
This commit is contained in:
@@ -160,7 +160,7 @@ static bool savedata_check_args(u32 operation, u32 version, vm::cptr<char> dirNa
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((operation >= SAVEDATA_OP_LIST_AUTO_SAVE && operation <= SAVEDATA_OP_FIXED_LOAD) || operation == SAVEDATA_OP_FIXED_DELETE)
|
if ((operation >= SAVEDATA_OP_LIST_AUTO_SAVE && operation <= SAVEDATA_OP_FIXED_LOAD) || operation == SAVEDATA_OP_FIXED_DELETE)
|
||||||
{
|
{
|
||||||
if (setBuf->dirListMax > CELL_SAVEDATA_DIRLIST_MAX)
|
if (setBuf->dirListMax > CELL_SAVEDATA_DIRLIST_MAX)
|
||||||
{
|
{
|
||||||
// ****** sysutil savedata parameter error : 8 ******
|
// ****** sysutil savedata parameter error : 8 ******
|
||||||
@@ -330,8 +330,6 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
|
|||||||
save_entry2.subtitle = psf.at("SUB_TITLE").as_string();
|
save_entry2.subtitle = psf.at("SUB_TITLE").as_string();
|
||||||
save_entry2.details = psf.at("DETAIL").as_string();
|
save_entry2.details = psf.at("DETAIL").as_string();
|
||||||
|
|
||||||
save_entry2.size = 0;
|
|
||||||
|
|
||||||
for (const auto entry2 : fs::dir(base_dir + entry.name))
|
for (const auto entry2 : fs::dir(base_dir + entry.name))
|
||||||
{
|
{
|
||||||
save_entry2.size += entry2.size;
|
save_entry2.size += entry2.size;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <Emu/Memory/vm_ptr.h>
|
#include <Emu/Memory/vm_ptr.h>
|
||||||
|
|
||||||
@@ -297,12 +297,12 @@ struct SaveDataEntry
|
|||||||
std::string title;
|
std::string title;
|
||||||
std::string subtitle;
|
std::string subtitle;
|
||||||
std::string details;
|
std::string details;
|
||||||
u64 size;
|
u64 size{0};
|
||||||
s64 atime;
|
s64 atime{0};
|
||||||
s64 mtime;
|
s64 mtime{0};
|
||||||
s64 ctime;
|
s64 ctime{0};
|
||||||
std::vector<uchar> iconBuf;
|
std::vector<uchar> iconBuf;
|
||||||
bool isNew;
|
bool isNew{false};
|
||||||
};
|
};
|
||||||
|
|
||||||
class SaveDialogBase
|
class SaveDialogBase
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "overlays.h"
|
#include "overlays.h"
|
||||||
|
|
||||||
namespace rsx
|
namespace rsx
|
||||||
@@ -179,7 +179,7 @@ namespace rsx
|
|||||||
m_description->set_text("Save");
|
m_description->set_text("Save");
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool newpos_head = listSet->newData && listSet->newData->iconPosition == CELL_SAVEDATA_ICONPOS_HEAD;
|
const bool newpos_head = listSet && listSet->newData && listSet->newData->iconPosition == CELL_SAVEDATA_ICONPOS_HEAD;
|
||||||
|
|
||||||
if (!newpos_head)
|
if (!newpos_head)
|
||||||
{
|
{
|
||||||
@@ -189,7 +189,7 @@ namespace rsx
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listSet->newData)
|
if (listSet && listSet->newData)
|
||||||
{
|
{
|
||||||
std::unique_ptr<overlay_element> new_stub;
|
std::unique_ptr<overlay_element> new_stub;
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ save_data_list_dialog::save_data_list_dialog(const std::vector<SaveDataEntry>& e
|
|||||||
UpdateSelectionLabel();
|
UpdateSelectionLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listSet->newData)
|
if (listSet && listSet->newData)
|
||||||
{
|
{
|
||||||
QPushButton *saveNewEntry = new QPushButton(tr("Save New Entry"), this);
|
QPushButton *saveNewEntry = new QPushButton(tr("Save New Entry"), this);
|
||||||
connect(saveNewEntry, &QAbstractButton::clicked, this, [&]()
|
connect(saveNewEntry, &QAbstractButton::clicked, this, [&]()
|
||||||
|
|||||||
Reference in New Issue
Block a user