Seek before reading save state screenshot

Fixes corrupted thumbnails in the save state UI
This commit is contained in:
Silent 2020-09-05 21:46:46 +02:00
parent fd0a009a7f
commit 33df4ab1bd
No known key found for this signature in database
GPG Key ID: AE53149BB0C45AF1
1 changed files with 1 additions and 0 deletions

View File

@ -1820,6 +1820,7 @@ CommonHostInterface::GetExtendedSaveStateInfo(const char* game_code, s32 slot)
if (header.screenshot_width > 0 && header.screenshot_height > 0 && header.screenshot_size > 0 &&
(static_cast<u64>(header.offset_to_screenshot) + static_cast<u64>(header.screenshot_size)) <= stream->GetSize())
{
stream->SeekAbsolute(header.offset_to_screenshot);
ssi.screenshot_data.resize((header.screenshot_size + 3u) / 4u);
if (stream->Read2(ssi.screenshot_data.data(), header.screenshot_size))
{