Don't use the offset for the current local buffer

Using the offset in the calculation for the local buffer is leading to
access a wrong memory address.

Signed-off-by: Vinzenz Feenstra <evilissimo@gmail.com>