Fix map_extract

Reported by cheeser0613
This commit is contained in:
def 2021-11-13 21:07:03 +01:00
parent 114acb4887
commit 2b50a1e712

View file

@ -51,17 +51,17 @@ bool Process(IStorage *pStorage, const char *pMapName, const char *pPathSave)
dbg_msg("map_extract", "writing image: %s (%dx%d)", aBuf, pItem->m_Width, pItem->m_Height);
// copy image data
IOHANDLE File = io_open(pPathSave, IOFLAG_WRITE);
IOHANDLE File = io_open(aBuf, IOFLAG_WRITE);
if(!File)
{
dbg_msg("map_extract", "failed to open file. filename='%s'", pPathSave);
dbg_msg("map_extract", "failed to open file. filename='%s'", aBuf);
continue;
}
png_t Png;
int Error = png_open_write(&Png, 0, File);
if(Error != PNG_NO_ERROR)
{
dbg_msg("map_extract", "failed to write image file. filename='%s', pnglite: %s", pPathSave, png_error_string(Error));
dbg_msg("map_extract", "failed to write image file. filename='%s', pnglite: %s", aBuf, png_error_string(Error));
}
else
{