eliminate the intermediate reader for the savegame pics.

This commit is contained in:
Christoph Oelckers 2023-12-13 18:20:18 +01:00
parent 78a71bb662
commit 301323944f

View file

@ -316,10 +316,7 @@ unsigned FSavegameManagerBase::ExtractSaveData(int index)
auto pic = resf->FindEntry("savepic.png");
if (pic >= 0)
{
FileReader picreader;
// we must create a memory reader copy of the PNG if we want to close the savegame file here.
auto rd = resf->Read(pic);
picreader.OpenMemoryArray(rd);
FileReader picreader = resf->GetEntryReader(pic, true);
PNGHandle *png = M_VerifyPNG(picreader);
if (png != nullptr)
{