Mercurial > hg > dmlib
comparison tools/lib64fmts.c @ 1838:d02514ceed91
Fix Fun Paint 2 packed variant writing, it was missing one byte (the "is packed" flag).
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 22 Jun 2018 18:21:36 +0300 |
parents | 69871828838c |
children | 666b27999570 |
comparison
equal
deleted
inserted
replaced
1837:cc4570c0bca5 | 1838:d02514ceed91 |
---|---|
751 | 751 |
752 static int fmtEncodeFunPaint2Unpacked(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) | 752 static int fmtEncodeFunPaint2Unpacked(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) |
753 { | 753 { |
754 // Add the header bits | 754 // Add the header bits |
755 if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) || | 755 if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) || |
756 !dmGrowBufPutU8(buf, 0) || | 756 !dmGrowBufPutU8(buf, 0) || // 0 == unpacked variant |
757 !dmGrowBufPutU8(buf, 0)) | 757 !dmGrowBufPutU8(buf, 0)) // RLE marker byte (not used in unpacked) |
758 return DMERR_MALLOC; | 758 return DMERR_MALLOC; |
759 | 759 |
760 return dmC64EncodeGenericBMP(FALSE, buf, img, fmt); | 760 return dmC64EncodeGenericBMP(FALSE, buf, img, fmt); |
761 } | 761 } |
762 | 762 |
780 | 780 |
781 dmGenericRLEAnalyze(&mem, &cfg); | 781 dmGenericRLEAnalyze(&mem, &cfg); |
782 | 782 |
783 // Add the header bits | 783 // Add the header bits |
784 if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) || | 784 if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) || |
785 !dmGrowBufPutU8(buf, 1) || // non-zero == packed variant | |
785 !dmGrowBufPutU8(buf, cfg.rleMarkerB)) | 786 !dmGrowBufPutU8(buf, cfg.rleMarkerB)) |
786 { | 787 { |
787 res = DMERR_MALLOC; | 788 res = DMERR_MALLOC; |
788 goto out; | 789 goto out; |
789 } | 790 } |