buffer: fix result regression in nearest sampler

This fixes a regression in GIMPs live transform preview.