Skip to content

Commit

Permalink
fixed savepic loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Dec 10, 2023
1 parent 42ab7dd commit 6ff667a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/common/menu/savegamemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,15 @@ unsigned FSavegameManagerBase::ExtractSaveData(int index)
auto pic = resf->FindEntry("savepic.png");
if (pic >= 0)
{
FileReader picreader = resf->GetEntryReader(pic);
FileReader picreader;

picreader.OpenMemoryArray([=](std::vector<uint8_t>& array)
{
auto rd = resf->GetEntryReader(pic, false);
array.resize(resf->Length(pic));
rd.Read(array.data(), array.size());
return true;
});
PNGHandle *png = M_VerifyPNG(picreader);
if (png != nullptr)
{
Expand Down

0 comments on commit 6ff667a

Please sign in to comment.