With negative stride, the start of the edge_emu buffer should be pointing to the last line, not the end of the buffer. With positive stride, pointing to the end of the buffer was completely wrong.