Fix undefined behavior in decoder.

Use memmove() for copying overlapping buffers.
Merge pull request #21 from szabadka/master

Fix undefined behavior in decoder.