diff options
Diffstat (limited to 'csrc')
-rw-r--r-- | csrc/mkf_decompress.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/csrc/mkf_decompress.c b/csrc/mkf_decompress.c index ea9ac4f..ba0df17 100644 --- a/csrc/mkf_decompress.c +++ b/csrc/mkf_decompress.c @@ -662,27 +662,18 @@ void mkf_decompress(void *arg1, void *arg2) ecx = old_ecx + eax; if (dx == 0xfff) return; - old_ecx = ecx; + bx -= 0xfd; void *old_esi = esi; esi = edi - 1 - dx; - /* the following is a little bit tricky, - * if we use memcpy/memmove, the picture is broken - */ -#if 1 - ecx = bx; - do { + /* note that it's not memcpy/memmove!! */ + for (size_t i = 0; i < bx; i++) { *(uint8_t*)edi = *(uint8_t*)esi; edi++; esi++; - ecx--; - } while (ecx); -#else - memmove(edi, esi, bx); /* using rep movsb */ - edi += bx; /* by movsb */ -#endif + } + esi = old_esi; - ecx = old_ecx; } } |