av_samples_copy: support overlapping copies