From e6a7161e870c42fe25b5d16f33daabc93cb984b4 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 9 May 2016 07:39:57 -0400 Subject: [PATCH] Made some minor corrections on the copyback of misplaced write data. --- Outputs/CRT/Internals/CRTInputBufferBuilder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Outputs/CRT/Internals/CRTInputBufferBuilder.cpp b/Outputs/CRT/Internals/CRTInputBufferBuilder.cpp index 9cc3eae84..ebf36ae4b 100644 --- a/Outputs/CRT/Internals/CRTInputBufferBuilder.cpp +++ b/Outputs/CRT/Internals/CRTInputBufferBuilder.cpp @@ -53,9 +53,9 @@ void CRTInputBufferBuilder::reduce_previous_allocation_to(size_t actual_length) uint8_t *const image_pointer = _image.get(); // correct if the writing cursor was reset while a client was writing - if(_next_write_x_position == 0 && _next_write_y_position == 0 && _write_target_pointer != 1) + if(_next_write_x_position == 0 && _next_write_y_position == 0) { - memmove(&image_pointer[1], &image_pointer[_write_target_pointer], actual_length); + memmove(&image_pointer[1], &image_pointer[_write_target_pointer], actual_length * _bytes_per_pixel); _write_target_pointer = 1; _last_allocation_amount = actual_length; _next_write_x_position = (uint16_t)(actual_length + 2);