Mercurial > hg > dmlib
changeset 1783:1ce808599129
Add DM_RLE_ZERO_COUNT_MAX flag for RLE decoder which makes it interpret run
lengths of 0 as maximum value of the type, e.g. 256 or 65536 (latter is
probably useless.)
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 13 Jun 2018 01:34:46 +0300 |
parents | 22b6fa1a2ee4 |
children | a29d38862037 |
files | tools/lib64gfx.c tools/lib64gfx.h |
diffstat | 2 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/lib64gfx.c Wed Jun 13 01:23:45 2018 +0300 +++ b/tools/lib64gfx.c Wed Jun 13 01:34:46 2018 +0300 @@ -474,6 +474,9 @@ count = tmp2; break; } + + if (count == 0 && (cfg->flags & DM_RLE_ZERO_COUNT_MAX)) + count = 256; } else if ((cfg->flags & DM_RLE_WORD_RUNS) && data == cfg->rleMarkerW) @@ -499,6 +502,9 @@ count = (tmp3 << 8) | tmp2; break; } + + if (count == 0 && (cfg->flags & DM_RLE_ZERO_COUNT_MAX)) + count = 65536; } } else