# HG changeset patch # User Matti Hamalainen # Date 1503013955 -10800 # Node ID 642a0dd98c6e566ad60b4bd110c1a08ad2b92f2c # Parent 086f49d616aca57b1f09522006732798a2ea91a4 Oops, forgot to adjust the writing and reading when adding two members to the PCX header struct. diff -r 086f49d616ac -r 642a0dd98c6e src/libgfx.c --- a/src/libgfx.c Fri Aug 18 02:15:51 2017 +0300 +++ b/src/libgfx.c Fri Aug 18 02:52:35 2017 +0300 @@ -836,6 +836,8 @@ hdr.ymax = hdr.vres - 1; hdr.nplanes = dmImageGetBytesPerPixel(pcx.format); hdr.palInfo = 1; + hdr.hScreenSize = hdr.hres; + hdr.vScreenSize = hdr.vres; res = (img->width * spec->scaleX); hdr.bpl = res / 2; @@ -888,6 +890,8 @@ !dm_fwrite_byte(pcx.fp, hdr.nplanes) || !dm_fwrite_le16(pcx.fp, hdr.bpl) || !dm_fwrite_le16(pcx.fp, hdr.palInfo) || + !dm_fwrite_le16(pcx.fp, hdr.hScreenSize) || + !dm_fwrite_le16(pcx.fp, hdr.vScreenSize) || !dm_fwrite_str(pcx.fp, (Uint8 *) &hdr.filler, sizeof(hdr.filler))) { res = dmError(DMERR_FWRITE, @@ -1027,6 +1031,8 @@ !dm_fread_byte(fp, &hdr.nplanes) || !dm_fread_le16(fp, &hdr.bpl) || !dm_fread_le16(fp, &hdr.palInfo) || + !dm_fread_le16(fp, &hdr.hScreenSize) || + !dm_fread_le16(fp, &hdr.vScreenSize) || !dm_fread_str(fp, (Uint8 *) &hdr.filler, sizeof(hdr.filler))) { res = dmError(DMERR_FREAD,