mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-06 15:05:59 +00:00
Fixup Savestate Segfault
This commit is contained in:
parent
2e824827b7
commit
453a3c4852
6 changed files with 33 additions and 18 deletions
|
|
@ -150,12 +150,12 @@ usz uncompressed_serialization_file_handler::get_size(const utils::serial& ar, u
|
|||
{
|
||||
if (ar.is_writing())
|
||||
{
|
||||
return m_file->size();
|
||||
return *m_file ? m_file->size() : 0;
|
||||
}
|
||||
|
||||
const usz memory_available = ar.data_offset + ar.data.size();
|
||||
|
||||
if (memory_available >= recommended)
|
||||
if (memory_available >= recommended || !*m_file)
|
||||
{
|
||||
// Avoid calling size() if possible
|
||||
return memory_available;
|
||||
|
|
@ -756,12 +756,12 @@ usz compressed_serialization_file_handler::get_size(const utils::serial& ar, usz
|
|||
{
|
||||
if (ar.is_writing())
|
||||
{
|
||||
return m_file->size();
|
||||
return *m_file ? m_file->size() : 0;
|
||||
}
|
||||
|
||||
const usz memory_available = ar.data_offset + ar.data.size();
|
||||
|
||||
if (memory_available >= recommended)
|
||||
if (memory_available >= recommended || !*m_file)
|
||||
{
|
||||
// Avoid calling size() if possible
|
||||
return memory_available;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue