Skip to content

Commit

Permalink
pcx: make palette marker optional
Browse files Browse the repository at this point in the history
  • Loading branch information
0lvin committed Aug 31, 2024
1 parent b3efe33 commit eb3ea06
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/client/cl_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit eb3ea06

Please sign in to comment.