pcx: make palette marker optional

This commit is contained in:
Denis Pauk 2024-08-31 16:13:09 +03:00
parent b3efe338c1
commit eb3ea06fc9

View file

@ -360,9 +360,15 @@ PCX_Decode(const char *name, const byte *raw, int len, byte **pic, byte **palett
return; return;
} }
if ((len > 768) && (((byte *)pcx)[len - 769] == 0x0C)) if (len > 768)
{ {
memcpy(*palette, (byte *)pcx + len - 768, 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 else
{ {