Mercurial > hg > dmlib
changeset 1727:8eb5ff34864a
Improve error messages in the RLE decoder.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 07 Jun 2018 15:21:54 +0300 |
parents | f9128665a47e |
children | 80adcda72210 |
files | tools/lib64gfx.c |
diffstat | 1 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/lib64gfx.c Thu Jun 07 14:48:26 2018 +0300 +++ b/tools/lib64gfx.c Thu Jun 07 15:21:54 2018 +0300 @@ -385,7 +385,9 @@ if (!dmGrowBufGetU8(&src, &tmp1) || !dmGrowBufGetU8(&src, &tmp2)) { - res = DMERR_INVALID_DATA; + res = dmError(DMERR_INVALID_DATA, + "%s: RLE: Invalid data/out of data for byte length run sequence.\n", + cfg->func); goto out; } switch (cfg->flags & DM_RLE_ORDER_MASK) @@ -408,7 +410,9 @@ !dmGrowBufGetU8(&src, &tmp2) || !dmGrowBufGetU8(&src, &tmp3)) { - res = DMERR_INVALID_DATA; + res = dmError(DMERR_INVALID_DATA, + "%s: RLE: Invalid data/out of data for word length run sequence.\n", + cfg->func); goto out; } switch (cfg->flags & DM_RLE_ORDER_MASK) @@ -434,7 +438,9 @@ { if (!dmGrowBufGetU8(&src, &tmp1)) { - res = DMERR_INVALID_DATA; + res = dmError(DMERR_INVALID_DATA, + "%s: RLE: Invalid data/out of data for byte length mask/run sequence.\n", + cfg->func); goto out; } @@ -836,6 +842,7 @@ case DO_SET_OP: memset(blk->data, op->offs, size); break; + default: return dmError(DMERR_INTERNAL, "Unhandled op type %d in "