- fixed memory allocation type mismatch in demo code.

This commit is contained in:
Christoph Oelckers 2016-01-30 15:17:46 +01:00
parent afcd755c7a
commit 36911bac4b

View file

@ -2636,12 +2636,12 @@ bool G_ProcessIFFDemo (FString &mapname)
if (uncompSize > 0) if (uncompSize > 0)
{ {
BYTE *uncompressed = new BYTE[uncompSize]; BYTE *uncompressed = (BYTE*)M_Malloc(uncompSize);
int r = uncompress (uncompressed, &uncompSize, demo_p, uLong(zdembodyend - demo_p)); int r = uncompress (uncompressed, &uncompSize, demo_p, uLong(zdembodyend - demo_p));
if (r != Z_OK) if (r != Z_OK)
{ {
Printf ("Could not decompress demo! %s\n", M_ZLibError(r).GetChars()); Printf ("Could not decompress demo! %s\n", M_ZLibError(r).GetChars());
delete[] uncompressed; M_Free(uncompressed);
return true; return true;
} }
M_Free (demobuffer); M_Free (demobuffer);