From 33df4ab1bdec175a9b28c51b86d8f15bacdc8104 Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 5 Sep 2020 21:46:46 +0200 Subject: [PATCH] Seek before reading save state screenshot Fixes corrupted thumbnails in the save state UI --- src/frontend-common/common_host_interface.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/frontend-common/common_host_interface.cpp b/src/frontend-common/common_host_interface.cpp index 25acb6286..74f834644 100644 --- a/src/frontend-common/common_host_interface.cpp +++ b/src/frontend-common/common_host_interface.cpp @@ -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(header.offset_to_screenshot) + static_cast(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)) {