pcx: make palette marker optional

This commit is contained in:
Denis Pauk 2024-08-31 16:13:09 +03:00
parent b3efe338c1
commit eb3ea06fc9
1 changed files with 7 additions and 1 deletions

View File

@ -360,9 +360,15 @@ PCX_Decode(const char *name, const byte *raw, int len, byte **pic, byte **palett
return;
}
if ((len > 768) && (((byte *)pcx)[len - 769] == 0x0C))
if (len > 768)
{
memcpy(*palette, (byte *)pcx + len - 768, 768);
if ((((byte *)pcx)[len - 769] != 0x0C))
{
Com_DPrintf("%s: %s has no palette marker\n",
__func__, name);
}
}
else
{