FIX: do not repeat samples on buffer borders