Mercurial > hg > dmlib
comparison tools/lib64gfx.c @ 1790:523c1d1270d6
Fix output buffer cropping in dmFinishRLEBuffers() for DM_OUT_CROP_END case.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 13 Jun 2018 03:01:53 +0300 |
parents | 1ce808599129 |
children | 5204fab92c9e |
comparison
equal
deleted
inserted
replaced
1789:9f5c5ab0e85e | 1790:523c1d1270d6 |
---|---|
396 switch (cfg->flags & DM_OUT_CROP_MASK) | 396 switch (cfg->flags & DM_OUT_CROP_MASK) |
397 { | 397 { |
398 case DM_OUT_CROP_END: | 398 case DM_OUT_CROP_END: |
399 if (cfg->cropOutLen < dst->len) | 399 if (cfg->cropOutLen < dst->len) |
400 { | 400 { |
401 memmove(dst->data, dst->data + dst->len - cfg->cropOutLen + 1, cfg->cropOutLen); | 401 memmove(dst->data, dst->data + dst->len - cfg->cropOutLen + 1, cfg->cropOutLen - 1); |
402 dst->len = cfg->cropOutLen; | 402 dst->len = cfg->cropOutLen; |
403 } | 403 } |
404 break; | 404 break; |
405 | 405 |
406 case DM_OUT_CROP_START: | 406 case DM_OUT_CROP_START: |