Mercurial > hg > dmlib
comparison tools/lib64fmts.c @ 1749:feaf5cf07603
Apparently Fun Paint 2 also saves one byte less than it should with the
packed format .. so we need to extend our buffer.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 11 Jun 2018 14:23:52 +0300 |
parents | 9c4b3fecc510 |
children | 768fddda73e9 |
comparison
equal
deleted
inserted
replaced
1748:9c4b3fecc510 | 1749:feaf5cf07603 |
---|---|
571 cfg.func = fmt->name; | 571 cfg.func = fmt->name; |
572 cfg.type = DM_COMP_RLE_MARKER; | 572 cfg.type = DM_COMP_RLE_MARKER; |
573 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1; | 573 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1; |
574 cfg.rleMarkerB = buf->data[15]; | 574 cfg.rleMarkerB = buf->data[15]; |
575 | 575 |
576 dmGrowBufCopyOffs(&tmp, buf, FUNPAINT2_HEADER_SIZE, 1); | |
577 tmp.len = tmp.size; | |
578 | |
576 if ((res = dmDecodeGenericRLEAlloc( | 579 if ((res = dmDecodeGenericRLEAlloc( |
577 &mem, dmGrowBufCreateFromOffs(&tmp, buf, FUNPAINT2_HEADER_SIZE), &cfg)) == DMERR_OK) | 580 &mem, &tmp, &cfg)) == DMERR_OK) |
578 res = dmC64DecodeGenericBMP(img, &mem, fmt); | 581 res = dmC64DecodeGenericBMP(img, &mem, fmt); |
579 | 582 |
580 dmGrowBufFree(&mem); | 583 dmGrowBufFree(&mem); |
584 dmGrowBufFree(&tmp); | |
581 } | 585 } |
582 else | 586 else |
583 { | 587 { |
584 res = dmC64DecodeGenericBMP(img, dmGrowBufConstCopyOffs(&tmp, buf, FUNPAINT2_HEADER_SIZE), fmt); | 588 res = dmC64DecodeGenericBMP(img, dmGrowBufConstCopyOffs(&tmp, buf, FUNPAINT2_HEADER_SIZE), fmt); |
585 } | 589 } |