comparison tools/lib64gfx.c @ 2407:c5a32812dd97

Oops, forgot to set up the DMC64EncDecCtx::buf to point to the correct DMGrowBuf (source or destination) in dmC64EncodeGenericBMP() and dmC64DecodeGenericBMP(). Fixed.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 13 Jan 2020 21:16:57 +0200
parents 0b1928ed902f
children 69a5af2eb1ea
comparison
equal deleted inserted replaced
2406:b153bc46241d 2407:c5a32812dd97
912 912
913 if (buf == NULL || buf->data == NULL || img == NULL || fmt == NULL) 913 if (buf == NULL || buf->data == NULL || img == NULL || fmt == NULL)
914 return DMERR_NULLPTR; 914 return DMERR_NULLPTR;
915 915
916 dmC64SetupImageData(img, fmt); 916 dmC64SetupImageData(img, fmt);
917 ctx.buf = buf;
917 918
918 // Perform decoding 919 // Perform decoding
919 for (ctx.opn = 0; ctx.opn < D64_MAX_ENCDEC_OPS; ctx.opn++) 920 for (ctx.opn = 0; ctx.opn < D64_MAX_ENCDEC_OPS; ctx.opn++)
920 { 921 {
921 DMC64MemBlock *blk = NULL; 922 DMC64MemBlock *blk = NULL;
1114 if (buf->backwards) 1115 if (buf->backwards)
1115 { 1116 {
1116 return dmError(DMERR_INVALID_DATA, 1117 return dmError(DMERR_INVALID_DATA,
1117 "Buffer specified for dmC64EncodeGenericBMP() is in backwards mode, which is not supported.\n"); 1118 "Buffer specified for dmC64EncodeGenericBMP() is in backwards mode, which is not supported.\n");
1118 } 1119 }
1120
1121 ctx.buf = buf;
1119 1122
1120 // Perform encoding 1123 // Perform encoding
1121 for (ctx.opn = 0; ctx.opn < D64_MAX_ENCDEC_OPS; ctx.opn++) 1124 for (ctx.opn = 0; ctx.opn < D64_MAX_ENCDEC_OPS; ctx.opn++)
1122 { 1125 {
1123 const DMC64MemBlock *blk = NULL; 1126 const DMC64MemBlock *blk = NULL;