Fix possible double-free inside the image loader
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5333 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
9e98e44500
commit
6d4bd2eb61
1 changed files with 1 additions and 1 deletions
|
@ -5717,6 +5717,7 @@ static void Image_ChangeFormat(struct pendingtextureinfo *mips, unsigned int fla
|
||||||
}
|
}
|
||||||
|
|
||||||
//resamples and depalettes as required
|
//resamples and depalettes as required
|
||||||
|
//ALWAYS frees rawdata, even on failure (but never mips).
|
||||||
static qboolean Image_GenMip0(struct pendingtextureinfo *mips, unsigned int flags, void *rawdata, void *palettedata, int imgwidth, int imgheight, uploadfmt_t fmt, qboolean freedata)
|
static qboolean Image_GenMip0(struct pendingtextureinfo *mips, unsigned int flags, void *rawdata, void *palettedata, int imgwidth, int imgheight, uploadfmt_t fmt, qboolean freedata)
|
||||||
{
|
{
|
||||||
unsigned int *rgbadata = rawdata;
|
unsigned int *rgbadata = rawdata;
|
||||||
|
@ -6643,7 +6644,6 @@ static struct pendingtextureinfo *Image_LoadMipsFromMemory(int flags, const char
|
||||||
return mips;
|
return mips;
|
||||||
}
|
}
|
||||||
Z_Free(mips);
|
Z_Free(mips);
|
||||||
BZ_Free(rgbadata);
|
|
||||||
}
|
}
|
||||||
#ifdef FTE_TARGET_WEB
|
#ifdef FTE_TARGET_WEB
|
||||||
else if (1)
|
else if (1)
|
||||||
|
|
Loading…
Reference in a new issue