1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

rsx: fix reading zipped captures

This commit is contained in:
Megamouse 2023-11-09 22:31:55 +01:00 committed by Elad Ashkenazi
parent 840455b872
commit 06bdaf1fb1
3 changed files with 7 additions and 4 deletions

View File

@ -715,18 +715,21 @@ bool Emulator::BootRsxCapture(const std::string& path)
std::unique_ptr<rsx::frame_capture_data> frame = std::make_unique<rsx::frame_capture_data>(); std::unique_ptr<rsx::frame_capture_data> frame = std::make_unique<rsx::frame_capture_data>();
utils::serial load; utils::serial load;
load.m_file_handler = make_uncompressed_serialization_file_handler(std::move(in_file));
load.set_reading_state(); load.set_reading_state();
if (fmt::to_lower(path).ends_with(".gz")) if (fmt::to_lower(path).ends_with(".gz"))
{ {
load.data = unzip(load.data); load.data = unzip(in_file.to_vector<u8>());
if (load.data.empty()) if (load.data.empty())
{ {
sys_log.error("Failed to unzip rsx capture file!"); sys_log.error("Failed to unzip rsx capture file!");
return false; return false;
} }
} }
else
{
load.m_file_handler = make_uncompressed_serialization_file_handler(std::move(in_file));
}
load(*frame); load(*frame);
in_file.close(); in_file.close();

View File

@ -108,7 +108,7 @@ std::vector<std::pair<u16, u16>> get_savestate_versioning_data(fs::file&& file)
u64 offs = 0; u64 offs = 0;
file.read(offs); file.read(offs);
const usz fsize = file.size(); const usz fsize = file.size();
if (!offs || fsize <= offs) if (!offs || fsize <= offs)
{ {

View File

@ -453,7 +453,7 @@ namespace utils
const usz end_pos = pos + sizeof(T); const usz end_pos = pos + sizeof(T);
const usz size = get_size(end_pos); const usz size = get_size(end_pos);
using type = std::remove_const_t<T>; using type = std::remove_const_t<T>;
if (size >= end_pos) if (size >= end_pos)
{ {