diff tools/lib64gfx.c @ 1831:ce1a734b016f

Change the logic of how DMGrowBuf works in "backwards" growing mode. Adjust the code that uses this as well.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 22 Jun 2018 16:33:27 +0300
parents 6e1dd79c6bce
children 19d4f76e003d
line wrap: on
line diff
--- a/tools/lib64gfx.c	Fri Jun 22 16:17:06 2018 +0300
+++ b/tools/lib64gfx.c	Fri Jun 22 16:33:27 2018 +0300
@@ -385,14 +385,14 @@
 {
     if (cfg->flags & DM_RLE_BACKWARDS_INPUT)
     {
-        src->offs = src->len - 1;
+        src->offs = src->len;
         src->backwards = TRUE;
     }
 
     if (cfg->flags & DM_RLE_BACKWARDS_OUTPUT)
     {
         dst->backwards = TRUE;
-        dst->offs = dst->size - 1;
+        dst->offs = dst->size;
     }
 }
 
@@ -412,7 +412,7 @@
         case DM_OUT_CROP_END:
             if (cfg->cropOutLen < dst->len)
             {
-                memmove(dst->data, dst->data + dst->len - cfg->cropOutLen + 1, cfg->cropOutLen - 1);
+                memmove(dst->data, dst->data + dst->len - cfg->cropOutLen, cfg->cropOutLen);
                 dst->len = cfg->cropOutLen;
             }
             break;